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

# 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)
}
#> Warning: 'g_REML()' is deprecated and may be removed in a later version of the package. Please use 'g_mlm()' instead.
#> Warning: 'g_REML()' is deprecated and may be removed in a later version of the package. Please use 'g_mlm()' instead.
#> Warning: 'g_REML()' is deprecated and may be removed in a later version of the package. Please use 'g_mlm()' instead.
#> Warning: 'g_REML()' is deprecated and may be removed in a later version of the package. Please use 'g_mlm()' instead.
#> Warning: 'g_REML()' is deprecated and may be removed in a later version of the package. Please use 'g_mlm()' instead.
#>     p_beta  r_theta delta_AB       nu     kappa     g_AB     V_g_AB cnvg_warn
#> 1 27.06455 389.2161 1.371846 17.80571 0.1285793 1.313239 0.07283861         0
#> 2 26.34669 366.3961 1.376419 31.32638 0.1640322 1.343200 0.05851161         0
#> 3 35.11388 376.5170 1.809616 16.48640 0.1197036 1.726026 0.12014633         0
#> 4 31.42206 404.2402 1.562841 16.94285 0.1308293 1.492624 0.09400061         0
#> 5 30.06394 311.2703 1.704029 27.88870 0.1684046 1.657789 0.08273363         0
#>   sigma_sq        phi Tau.case.var((Intercept))
#> 1 161.3155 0.13846119                  227.9006
#> 2 222.1663 0.21665461                  144.2298
#> 3 144.3839 0.09381823                  232.1330
#> 4 161.7670 0.18809502                  242.4732
#> 5 181.2006 0.29071324                  130.0697