g_mlm: Calculates adjusted mlm effect size

View source: R/g_mlm.R

g_mlmR Documentation

Calculates adjusted mlm effect size

Description

Estimates a standardized mean difference effect size from a fitted multi-level model, using restricted or full maximum likelihood methods with small-sample correction, as described in Pustejovsky, Hedges, & Shadish (2014).

Usage

g_mlm(
  mod,
  p_const,
  mod_denom = mod,
  r_const = NULL,
  infotype = "expected",
  separate_variances = FALSE,
  ...
)

Arguments

mod

Fitted model of class lmeStruct (estimated using nlme::lme()) or of class glsStruct (estimated using nlme::gls()), from which to estimate the numerator of the effect size.

p_const

Vector of constants for calculating numerator of effect size. Must be the same length as fixed effects in mod.

mod_denom

Fitted model of class lmeStruct (estimated using nlme::lme()) or of class glsStruct (estimated using nlme::gls()), from which to estimate the denominator of the effect size. If not otherwise specified, the same model will be used for the numerator and the denominator calculations.

r_const

Vector of constants for calculating denominator of effect size. Must be the same length as the number of variance component parameters in mod_denom.

infotype

Type of information matrix. One of "expected" (the default), "observed", or "average".

separate_variances

Logical indicating whether to incorporate separate level-1 variance components in the calculation of the effect size and standard error for models with a 'varIdent()' variance structure. If TRUE, make sure the r_const matches the parameterization of the variance component as returned by extract_varcomp(mod, separate_variances = TRUE). Default is FALSE.

...

further arguments.

Value

A list with the following components

p_beta Numerator of effect size
r_theta Squared denominator of effect size
delta_AB Unadjusted (mlm) effect size estimate
nu Estimated denominator degrees of freedom
J_nu Biased correction factor for effect size estimate
kappa Scaled standard error of numerator
g_AB Corrected effect size estimate
SE_g_AB Approximate standard error estimate
theta Estimated variance component parameters
info_inv Inversed information matrix

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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3102/1076998614547577")}

Examples


library(nlme)
data(Bryant2016, package = "lmeInfo")
Bryant2016_RML1 <- lme(fixed = outcome ~ treatment,
                       random = ~ 1 | school/case,
                       correlation = corAR1(0, ~ session | school/case),
                       data = Bryant2016)
Bryant2016_g1 <- g_mlm(Bryant2016_RML1, p_const = c(0,1), r_const = c(1,1,0,1),
                       infotype = "expected")
print(Bryant2016_g1)
summary(Bryant2016_g1)


Bryant2016_RML2 <- lme(fixed = outcome ~ treatment,
                      random = ~ 1 | school/case,
                      correlation = corAR1(0, ~ session | school/case),
                      weights = varIdent(form = ~ 1 | treatment),
                      data = Bryant2016)
Bryant_g <- g_mlm(Bryant2016_RML2, p_const = c(0,1), r_const = c(1,1,0,0,1))
Bryant_g_baseline <- g_mlm(Bryant2016_RML2,
                           p_const = c(0,1),
                           r_const = c(1,1,0,1,0),
                           separate_variances = TRUE)
Bryant_g_treatment <- g_mlm(Bryant2016_RML2,
                            p_const = c(0,1),
                            r_const = c(1,1,0,0,1),
                            separate_variances = TRUE)
print(Bryant_g)
print(Bryant_g_baseline)
print(Bryant_g_treatment)



jepusto/lmeInfo documentation built on April 19, 2023, 6:49 a.m.