sim_ris: Simulate random intercept and slope data

Description Usage Arguments Examples

View source: R/sim.R

Description

Simulate data from a (balanced) random intercept and slope model.

Usage

1
sim_ris(m = 30, n = 10, mu = c(4.8, 3), sigma = c(1.3, 0.7, 0.7))

Arguments

m

Integer specifying the number of subjects.

n

Integer specifying the number of observations per subject.

mu

Numeric vector of length two giving the means of the random intercept and slope, respectively.

sigma

Numeric vector of length three giving the standard deviations of the random intercept, slope, and error term, respectively.

Examples

1
2
set.seed(101)  # for reproducibility
df <- sim_ris(m = 100, n = 15)

bgreenwell/bmisc documentation built on Sept. 24, 2019, 11:09 a.m.