Simulates data from a simple linear mixed effects model, then calculates REML and HPS effect size estimators as described in Pustejovsky, Hedges, & Shadish (2014).

compare_RML_HPS(iterations, beta, rho, phi, design, m, n, MB = TRUE)

Arguments

iterations

number of independent iterations of the simulation

beta

vector of fixed effect parameters

rho

intra-class correlation parameter

phi

autocorrelation parameter

design

design matrix. If not specified, it will be calculated based on m, n, and MB.

m

number of cases. Not used if design is specified.

n

number of measurement occasions. Not used if design is specified.

MB

If true, a multiple baseline design will be used; otherwise, an AB design will be used. Not used if design is specified.

Value

A matrix reporting the mean and variance of the effect size estimates and various associated statistics.

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577

Examples

compare_RML_HPS(iterations=10, beta = c(0,1,0,0), rho = 0.3, 
                 phi = 0.5, design=design_matrix(m=3,n=8))
#> 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.
#>                            mean         var
#> p_beta                0.9689801 0.132255250
#> r_theta               0.8129830 0.232028429
#> delta_AB              1.1322934 0.196608347
#> nu                   10.1076142 7.108926761
#> kappa                 0.3974902 0.002783619
#> g_AB                  1.0390001 0.164982487
#> V_g_AB                0.2602624 0.006271050
#> cnvg_warn             0.0000000 0.000000000
#> sigma_sq              0.6868876 0.276413201
#> phi                   0.3078962 0.064825916
#> Tau.id.var(constant)  0.1260954 0.011255191
#> rho                   0.1860981 0.021603200
#> RML_coverage1         1.0000000 0.000000000
#> RML_coverage2         1.0000000 0.000000000
#> D_bar                 1.0217338 0.152045584
#> S_sq                  0.9047772 0.468582432
#> delta_hat_unadj       1.1751807 0.274310697
#> phi_hat               0.1518184 0.037097185
#> rho_hat               0.3505721 0.026272017
#> kappa_hat             0.3574966 0.003683369
#> df                    8.0669433 7.921082705
#> delta_hat             1.0571183 0.249435622
#> V_delta_hat           0.2579169 0.009897738
#> HPS_coverage1         1.0000000 0.000000000
#> HPS_coverage2         1.0000000 0.000000000
#> cov                          NA 0.184995867