SimTrial {glmmrBase}R Documentation

Simulated data from a stepped-wedge cluster trial

Description

Simulated data from a stepped-wedge cluster trial

Examples

#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()

[Package glmmrBase version 0.11.1 Index]