Skip to contents

Given the output from a random intercept model and covariates of interest, compute the optimal linear coefficients.

Usage

get_coefs_randint(
  post_y_pred,
  XX,
  post_sigma_e,
  post_sigma_u,
  post_y_pred_sum = NULL
)

Arguments

post_y_pred

S x m x n matrix of posterior predictive draws at the covariate values for m replicates per subject

XX

n x p matrix of covariates (e.g., restricted to the subset of p variables 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)

Value

the p optimal regression coefficients