Simulate data from a fitted g_REML object

Share:

Description

Simulates data from the linear mixed effects model used to estimate the specified standardized mean difference effect size. Suitable for parametric bootstrapping.

Usage

1
2
3
## S3 method for class 'g_REML'
simulate(object, nsim = 1, seed = NULL, parallel = FALSE,
  ...)

Arguments

object

a g_REML object

nsim

number of models to simulate

seed

seed value. See documentation for simulate

parallel

if TRUE, run in parallel using foreach backend.

...

additional optional arguments

Value

A matrix with one row per simulation, with columns corresponding to the output of g_REML.

Examples

1
2
3
4
5
6
7
data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment, 
                 random = ~ 1 | case, 
                 correlation = corAR1(0, ~ time | case), 
                 data = Laski)
Laski_g <- g_REML(Laski_RML, p_const = c(0,1), r_const = c(1,0,1))
simulate(Laski_g, nsim = 20)