calc_exp_l2var: calc_exp_l2var

View source: R/calc_exp_l2var.R

calc_exp_l2varR Documentation

calc_exp_l2var

Description

calc_exp_l2var

Usage

calc_exp_l2var(
  .pct_mobile = 0,
  .clust_cov = c(0.8, 1),
  .wt_vec = c(0.5, 0.5),
  .u_resid_var = 0.2,
  .gamma_z = 1
)

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.

Value

A numeric scalar.


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