| gen_multilevel {iprior} | R Documentation | 
Generate simulated data for multilevel models
Description
Generate simulated data for multilevel models
Usage
gen_multilevel(
  n = 25,
  m = 6,
  sigma_e = 2,
  sigma_u0 = 2,
  sigma_u1 = 2,
  sigma_u01 = -2,
  beta0 = 0,
  beta1 = 2,
  x.jitter = 0.5,
  seed = NULL
)
Arguments
| n | Sample size. Input either a single number for a balanced data set,
or a vector of length  | 
| m | Number of groups/levels. | 
| sigma_e | The standard deviation of the errors. | 
| sigma_u0 | The standard deviation of the random intercept. | 
| sigma_u1 | The standard deviation of the random slopes. | 
| sigma_u01 | The covariance of between the random intercept and the random slope. | 
| beta0 | The mean of the random intercept. | 
| beta1 | The mean of the random slope. | 
| x.jitter | A small amount of jitter is added to the  | 
| seed | (Optional) Random seed. | 
Value
A dataframe containing the response variable y, the
unidimensional explanatory variables X, and the levels/groups
(factors).
Examples
gen_multilevel()