gen_xr_rnorm: gen_xr_rnorm

View source: R/gen_xr_rnorm.R

gen_xr_rnormR Documentation

gen_xr_rnorm

Description

gen_xr_rnorm

Usage

gen_xr_rnorm(.n_stu, .n_sch, .mean_x, .var_x, .mean_r, .var_r)

Arguments

.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 .n_sch x .n_sch.

.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.

Value

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.

Examples

## Not run: 

gen_xr_rnorm(.n_stu = 5, .n_sch = 5)


## End(Not run)

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