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 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 32.31720 593.3120 1.326759 13.28751 0.1058721 1.250436 0.08308929         0
#> 2 31.75284 389.1219 1.609680 16.52986 0.1204978 1.535524 0.09812399         0
#> 3 31.73550 669.7560 1.226273 13.14452 0.1156042 1.154948 0.07566976         0
#> 4 28.35262 303.4307 1.627659 36.63297 0.1919549 1.594107 0.07445739         0
#> 5 28.60165 620.6994 1.148023 13.45935 0.1173376 1.082840 0.06708274         0
#>   sigma_sq       phi Tau.case.var((Intercept))
#> 1 178.1521 0.0929177                 415.15986
#> 2 149.7504 0.1003007                 239.37157
#> 3 202.5012 0.2120793                 467.25479
#> 4 208.2126 0.3824273                  95.21807
#> 5 193.6831 0.2107770                 427.01626