est_smd: Standardized Mean Difference

View source: R/Est-SMD.R

est_smdR Documentation

Standardized Mean Difference

Description

Estimates the standardized mean difference with or without adjusting for clustering

Usage

est_smd(
  outcome = NULL,
  groups = NULL,
  m1 = NULL,
  m2 = NULL,
  sdp = NULL,
  sd1 = NULL,
  sd2 = NULL,
  n1 = NULL,
  n2 = NULL,
  hedges.g = FALSE,
  clusters = NULL,
  cluster.n = NULL,
  icc = NULL
)

Arguments

outcome

numeric vector of outcome values

groups

factor or character vector with 2 levels indicating group membership

m1

mean for group 1

m2

mean for group 2

sdp

user-specified divisor for estimating the smd (e.g., population sd, pooled sd)

sd1

standard deviation for group 1

sd2

standard deviation for group 2

n1

sample size for group 1

n2

sample size for group 2

hedges.g

unbiased estimation of standardized mean difference?

clusters

vector indicating cluster membership

cluster.n

average cluster size (assumed to be equal for both groups)

icc

intraclass correlation - proportion of total variance that is between cluster variance

Details

The standardized mean difference can be estimated from the raw data (outcome, groups, clusters) or from the sample statistics. If raw data is supplied the pooled standard deviation is used as the divisor unless sdp is specified.

When clusters is supplied, the average cluster size for each group is calculated via Equation 19 in Hedges (2007). cluster.n is then defined as the mean of the average cluster size for the two groups. icc is estimated from an unconditional random effects model via lmer. The smd and standard error estimates are cluster-adjusted using Equations 15 and 16 in Hedges (2007).

Value

If sample sizes are supplied (raw data or both n1 and n2), the standardized mean difference and its standard error are returned in a data.frame. Otherwise only the estimated standardized mean difference is returned as a numeric value.

References

Cohen, J. (1988). Statistical power analysis for the behavioral sciences (2nd ed.). Hillsdale, NJ: Lawrence Erlbaum. Hedges, L. V. (1981). Distribution theory for Glass’s estimator of effect size and related estimators. Journal of Educational Statistics, 6(2), 107–128. Hedges, L. V. (2007). Effect sizes in cluster-randomized designs. Journal of Educational and Behavioral Statistics, 32(4), 341-370.


knickodem/WBdif documentation built on Feb. 3, 2024, 2:20 a.m.