Learn R Programming

glmmrBase (version 1.0.0)

SimTrial: Simulated data from a stepped-wedge cluster trial

Description

Simulated data from a stepped-wedge cluster trial

Arguments

Examples

Run this code
#Data were generated with the following code:
SimTrial <- nelder(~ (cl(10)*t(7))>i(10))
SimTrial$int <- 0
SimTrial[SimTrial$t > SimTrial$cl,'int'] <- 1

model <- Model$new(
  formula = ~ int + factor(t) - 1 + (1|gr(cl)*ar1(t)),
  covariance = c(0.05,0.8),
  mean = rep(0,8),
  data = SimTrial,
  family = gaussian()
)

SimTrial$y <- model$sim_data()

Run the code above in your browser using DataLab