Learn R Programming

scdhlm (version 0.3)

simulate.g_REML: Simulate data from a fitted g_REML object

Description

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

Usage

"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

Run this code
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)

Run the code above in your browser using DataLab