Compute the optimal linear coefficients for any covariates under a random intercept model
Source:R/source_subsel.R
get_coefs_randint.RdGiven the output from a random intercept model and covariates of interest, compute the optimal linear coefficients.
Arguments
- post_y_pred
S x m x nmatrix of posterior predictive draws at the covariate values formreplicates per subject- XX
n x pmatrix of covariates (e.g., restricted to the subset ofpvariables of interest)- post_sigma_e
(
nsave) draws from the posterior distribution of the observation error SD- post_sigma_u
(
nsave) draws from the posterior distribution of the random intercept SD- post_y_pred_sum
(
nsave x n) matrix of the posterior predictive draws summed over the replicates within each subject (optional)