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 = 20)
}
#> 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.
#> 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.
#> 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.
#> 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.20714 377.5793 1.657479 24.83382 0.16333353 1.606913 0.08470266         0
#> 2  30.75507 402.0798 1.533771 18.06568 0.13467987 1.469203 0.08736829         0
#> 3  32.40649 753.7607 1.180362 12.17930 0.10971707 1.106152 0.07475795         0
#> 4  24.20217 288.5172 1.424848 26.26765 0.17987371 1.383774 0.07306843         0
#> 5  27.08715 371.2225 1.405873 14.76087 0.13220887 1.333210 0.08971997         0
#> 6  32.88559 519.3657 1.443009 16.71286 0.13693957 1.377270 0.08540320         0
#> 7  29.07827 458.3075 1.358282 17.74673 0.15318393 1.300059 0.07909340         0
#> 8  31.72756 308.7258 1.805719 30.67380 0.15426418 1.761205 0.07898923         0
#> 9  29.24707 332.0933 1.604916 19.29700 0.13686388 1.541720 0.08939879         0
#> 10 30.80133 632.6504 1.224581 10.31987 0.08993762 1.133375 0.08888032         0
#> 11 29.78626 677.6714 1.144212 13.07155 0.11880410 1.077281 0.06880475         0
#> 12 31.52949 401.7472 1.573042 15.73698 0.12870839 1.496863 0.10080805         0
#> 13 29.33597 446.9444 1.387630 18.96056 0.14416622 1.332008 0.07480473         0
#> 14 29.28046 413.6650 1.439638 22.27136 0.14521552 1.390607 0.07015432         0
#> 15 29.89300 490.3308 1.349973 16.29118 0.13958423 1.286855 0.07953753         0
#> 16 28.61496 323.6320 1.590624 24.33269 0.15406978 1.541087 0.07830327         0
#> 17 32.86999 323.3627 1.827909 21.14692 0.13216352 1.762305 0.10054174         0
#> 18 34.31940 234.1717 2.242707 51.43514 0.18349746 2.209846 0.08377374         0
#> 19 34.38374 697.3974 1.302006 13.85894 0.13342845 1.230251 0.08424429         0
#> 20 32.91714 330.1084 1.811731 18.93945 0.15094181 1.739027 0.11459837         0
#>    sigma_sq       phi Tau.case.var((Intercept))
#> 1  205.8839 0.2940056                 171.69537
#> 2  170.3602 0.1888524                 231.71963
#> 3  203.8525 0.2172313                 549.90816
#> 4  169.1708 0.4111142                 119.34637
#> 5  132.2297 0.2953915                 238.99279
#> 6  208.2742 0.2559869                 311.09153
#> 7  200.8823 0.3766164                 257.42523
#> 8  182.5034 0.1457948                 126.22241
#> 9  148.0951 0.1751573                 183.99829
#> 10 123.1369 0.1666621                 509.51352
#> 11 205.1672 0.2531608                 472.50415
#> 12 150.3864 0.2132465                 251.36089
#> 13 199.8350 0.2514879                 247.10932
#> 14 205.0468 0.1846242                 208.61828
#> 15 193.9446 0.2988366                 296.38621
#> 16 171.2402 0.2243766                 152.39178
#> 17 152.0511 0.0902153                 171.31158
#> 18 174.9049 0.2304097                  59.26676
#> 19 234.9309 0.3629529                 462.46649
#> 20 149.9315 0.3149732                 180.17687