simulate.g_REML: Simulate data from a fitted 'g_REML' object

simulate.g_REMLR Documentation

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

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

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment,
                 random = ~ 1 | case,
                 correlation = corAR1(0, ~ time | case), 
                 data = Laski)

suppressWarnings(
  Laski_g <- g_REML(Laski_RML, p_const = c(0,1), r_const = c(1,0,1))
)

if (requireNamespace("plyr", quietly = TRUE)) {
  simulate(Laski_g, nsim = 5)
}

scdhlm documentation built on March 31, 2023, 10:55 p.m.