expand_sch | R Documentation |
This function expands school-level information generated by
gen_u_mmrem
, repeating each school's info a number of times
equal to the number of students attending each school. That is, if there
are .n_stu
per school and .n_sch
, the final output should have
.n_stu * .n_sch
rows.
expand_sch(.sch_dat, .n_stu, .n_sch)
.sch_dat |
A matrix or dataframe. The school-level information created
by the |
.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
|
This function returns a dataframe with a number of rows equal to
.n_stu * .n_sch
. The columns of the input data (.sch_dat
) are
retained in the output.
## Not run: # generate data using the gen_u_mmrem function dat <- gen_u_mmrem(.n_sch = 10) # expand the data to repeat school information for each student # attending a given school expand_sch(dat, .n_stu = 10, .n_sch = 10) ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.