Learn R Programming

simglm (version 0.8.0)

cross_class: Cross Classified Generation

Description

Input cross classified simulation parameters, output cross classified structure as a function of the original id variables. This function currently only supports a single (intercept) cross classified random effect.

Usage

cross_class(num_ids, samp_size, random_param)

Arguments

num_ids

Number of cross classified ids to generate.

samp_size

Sample size to generate, this is used to pass to the sample function.

random_param

A list of data generating characteristics used to generate the cross classified random effect. This function needs to include:

  • random_var The variance of the cross classified random effect.

  • rand_gen The random generating function used.

Optional elements are:

  • ther: Theorectial mean and variance from rand_gen,

  • ther_sim: Simulate mean/variance for standardization purposes,

  • cor_vars: Correlation between random effects,

  • ...: Additional parameters needed for rand_gen function.

See sim_rand_eff for additional parameters that can be passed.