gen_xr_rnorm | R Documentation |
gen_xr_rnorm
gen_xr_rnorm(.n_stu, .n_sch, .mean_x, .var_x, .mean_r, .var_r)
.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. |
.n_sch |
Numeric scalar. Gives the total number of schools in the
dataset. The variance-covariance matrix for predictor z will have dimensions
|
.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. |
This function returns a dataframe with two columns,
x_predictor
and r_residual
. The predictor, x, is a person-level
predictor of the person-level outcome, y (generated using
gen_y_mmrem
). The person-specific error, or residual, r, and
the person-level predictor, x, are both continuous and normally distributed,
generated using the Normal
function.
## Not run: gen_xr_rnorm(.n_stu = 5, .n_sch = 5) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.