Learn R Programming

scdhlm (version 0.7.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

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

Value

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

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

Examples

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

Run the code above in your browser using DataLab