calc_exp_icc: calc_exp_icc

View source: R/calc_exp_icc.R

calc_exp_iccR Documentation

calc_exp_icc

Description

calc_exp_icc

Usage

calc_exp_icc(
  .pct_mobile = 0.2,
  .clust_cov = c(0.8, 0.1),
  .wt_vec = c(0.5, 0.5),
  .u_resid_var = 0.2,
  .gamma_z = 1,
  .gamma_x = c(10, 1.5),
  .var_x = 4,
  .var_r = 2
)

Arguments

.clust_cov

Numeric vector. The first element of the vector gives the variance of all schools' predictors, z. If present, the second element gives the covariance of z between schools k and k + 1. The values given in .clust_cov apply to all schools (that is, similar to a Toeplitz pattern). Any off-diagonal values (i.e., covariances) not specified will default to 0. The main diagonal is the variance explained by the predictor.

.wt_vec

A numeric vector with length equal to the maximum number of schools attended by students in the data (in this simulation, the maximum number is 2). The values in .wt_vec are used to weight the effects of different schools attended on students. For this study, all mobile students must have the same weights. If different weighting patterns are desired, the code will need to be updated.

.u_resid_var

Numeric scalar. Gives the residual variance of u0j (i.e., the variance unexplained after controlling for the school-level predictor, z).

.gamma_z

Numeric scalar. The school-level effect of the z_predictors on the random intercept.

.gamma_x

Numeric vector with length p (where p is the number of model coefficients, including the intercept).

.var_x

Numeric scalar. The variance of the predictor, x.

.var_r

Numeric scalar. The variance of the person-level residual, r.

Value

A numeric scalar.


tessaleejohnson/corclus documentation built on Oct. 11, 2022, 3:46 a.m.