list_conditions_datagen | R Documentation |
Wraps around list_conditions
to expand all combinations of
the arguments passed to the function. The arguments can
then be passed to purrr::pmap
(map2
) to iterate
over all simulation conditions.
list_conditions_datagen( .n_sch = 50, .n_stu = 50, .u_resid_var = 0.2, .clust_cov = list(c(0.8, 0), c(0.8, 0.2), c(0.8, 0.4)), .wt_vec = list(c(0.5, 0.5)), .pct_mobile = c(0, 0.25, 0.5), .mean_x = 5, .var_x = 4, .mean_r = 0, .var_r = 2, .gamma_z = 1, .gamma_x = list(c(10, sqrt(17)/2), c(10, sqrt(11/3)/2), c(10, 1/(2 * sqrt(3)))) )
.n_sch |
Numeric scalar. Gives the total number of schools in the
dataset. The variance-covariance matrix for predictor z will have dimensions
|
.n_stu |
A numeric scalar. The number of students attending each school. Note: this is not the total number of students in the dataset, merely the number of students per school. |
.u_resid_var |
Numeric scalar. Gives the residual variance of u0j (i.e., the variance unexplained after controlling for the school-level predictor, z). |
.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
|
.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 |
.mean_x |
Numeric scalar. The mean of the predictor, x. |
.var_x |
Numeric scalar. The variance of the predictor, x. |
.mean_r |
Numeric scalar. The mean of the person-level residual, r. |
.var_r |
Numeric scalar. The variance of the person-level residual, r. |
.gamma_z |
Numeric scalar. The school-level effect of the
|
.gamma_x |
Numeric vector with length p (where p is the number of model coefficients, including the intercept). |
NOTE: All arguments that take objects with length > 1 must
wrap those objects in a list.
Bad: list_conditions_datagen(.clust_cov = c(0.8, 0))
.
Good: list_conditions_datagen(.clust_cov = list(c(0.8, 0)))
.
This function returns a list of all combinations of arguments passed to this function. Each list element is an argument with length equal to the number of combinations.
## Not run: list_conditions_datagen(.nsch = 5, .pct_mobile = 0.1) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.