
Harmonized Standardized Mean Differences
hsmd.RdComputes traditional standardized mean differences (SMDs) and harmonized
standardized mean differences (HSMDs) by replacing observed group standard
deviations with common coefficient-of-variation benchmarks. Pooled summaries
are estimated with mars(), allowing the harmonized effect sizes to be
analyzed with univariate, multivariate, or multilevel model structures.
Usage
hsmd(
data,
mT,
sdT,
nT,
mC,
sdC,
nC,
study = NULL,
probs = c(0.25, 0.5, 0.75),
measure = c("d", "g"),
structure = "univariate",
formula = NULL,
effectID = NULL,
sample_size = NULL,
varcov_type = NULL,
variance = NULL,
cv_by = NULL,
cv_benchmarks = NULL,
estimation_method = "REML",
...
)
# S3 method for class 'hsmd'
print(x, digits = max(3, getOption("digits") - 3), ...)Arguments
- data
A data frame containing treatment and control summary statistics.
- mT, sdT, nT
Unquoted column names for treatment-group mean, standard deviation, and sample size. Observed values must be finite numeric values; sample sizes must be integers greater than 1 and SDs non-negative. Missing SDs are permitted when benchmarks can be estimated or supplied.
- mC, sdC, nC
Unquoted column names for control-group mean, standard deviation, and sample size.
- study
Optional unquoted column name identifying studies. If omitted, a sequential study identifier is created.
- probs
Numeric vector of coefficient-of-variation quantiles to use for harmonization. Defaults to
c(0.25, 0.50, 0.75). Values must be distinct and strictly between zero and one. Decimal percentage labels usep, so 0.251 generates columns such asd25p1.- measure
Effect-size estimate used in the fitted
mars()models, either"d"for Cohen's d or"g"for Hedges' g. Both estimates are returned.- structure
Model structure passed to
mars(). Use"univariate","multivariate"/"UN"/"DIAG1"/"DIAG2", or"multilevel".- formula
Optional model formula for univariate or multilevel models. The left-hand side is replaced internally with each SMD/HSMD effect-size column, so callers may supply either a one-sided formula (for example
~ 1 + (1 | district/study)) or a two-sided formula.- effectID
Optional column identifying dependent effect sizes for multivariate models.
- sample_size
Optional sample-size column passed to
mars()for multivariate SMD workflows.- varcov_type
Within-study variance-covariance type passed to
mars(). Defaults to"univariate","outcome", or"multilevel"depending onstructure. Supported choices areunivariate,multilevel,outcome(orsmd_outcome), and the SMD shared-control typescontrol,smd_control, andsmd_shared_control. Outcome covariance requires one commonr2docorrelation per dependent study and equal arm sample sizes across its outcomes; singleton studies need no correlation. Both covariance axes are adjusted whenmeasure = "g".- variance
Optional variance column used when the selected
varcov_typerequires an explicit variance argument.- cv_by
Optional unquoted column used to compute coefficient-of-variation benchmarks within subgroups, such as outcomes or domains. Group IDs cannot be missing. One or several quantiles may be requested.
- cv_benchmarks
Optional named list with elements
treatmentandcontrol, each a positive finite numeric vector aligned withprobs. Withcv_by, provide matrices/data frames whose row names identify groups and whose columns followprobsin the supplied order.- estimation_method
Estimation method passed to
mars(), either"REML"or"MLE".- ...
Additional arguments passed to downstream print methods.
- x
An object of class
"hsmd".- digits
Number of digits used when printing numeric results.
Value
A list with class "hsmd" containing:
- summary
Coefficient estimates, uncertainty and actual analysis counts.
tau2andI2are populated only for univariate models.- heterogeneity
Separate named variance components for each model, without truncating or assigning components to regression coefficients.
- cv_benchmarks
Treatment and control CV benchmarks used.
- inference
A reminder of the conditional sensitivity interpretation.
- effect_sizes
Data frame of study-level effect sizes and variances.
- data
Original input data with added coefficient-of-variation and harmonized SD columns. Internal
nt/nccolumns always reflect the explicitly selected sample-size columns.- models
Named list of fitted
marsmodel objects.- quantiles
Named numeric vector of the requested harmonization quantiles.
Details
HSMD is a sensitivity analysis of standardizer variability. CVs use \(s/|m|\); harmonized SDs use \(|m|\times CV_q\). Means must be nonzero and the outcome needs a meaningful ratio-scale origin. No fixed numerical floor is used, so positive changes of measurement units preserve the results. Negative means trigger a scale-suitability warning. A shift of origin can change HSMD, even when it leaves conventional SMD unchanged.
Conventional d uses the pooled SD and the large-sample variance \(1/n_T+1/n_C+d^2/[2(n_T+n_C)]\). The approximate correction is \(J=1-3/[4(n_T+n_C-2)-1]\), with \(g=Jd\) and \(v_g=J^2v_d\). These conventions are also applied to harmonized effects as sensitivity calculations; they do not propagate uncertainty in estimated CV benchmarks. They should not be interpreted as unconditional inference for an independently validated new effect-size estimator.
Each model receives only its required analysis columns. A missing original
SD does not exclude a computable harmonized effect, and unrelated missing
columns do not affect fitting. Required moderators still follow the selected
missing policy. Compare n_effects and n_studies before comparing models:
changes in the study set can accompany changes in the standardizer. At least
two usable effects are required per fit; use hsmd_effect_sizes() to inspect
effects when a model cannot be fitted. avwW uses the fitted covariance
diagonals. Full covariance and heterogeneity information remains in models.
References
Jung, J. and Aloe, A. M. (2025). Standardized Mean Differences: Not So Standard After All. Campbell Systematic Reviews, 21, e70056. doi:10.1002/cl2.70056 .
Examples
ex1 <- hsmd(
data = hsmd_example_1,
mT = mT, sdT = sdT, nT = nT,
mC = mC, sdC = sdC, nC = nC,
study = Study
)
ex1$summary
#> method component est se ci.lb ci.ub tau2
#> 1 SMD (Intercept) -0.3482182 0.10640132 -0.5567610 -0.13967543 0.11743967
#> 2 HSMD_25 (Intercept) -0.5182606 0.22512743 -0.9595023 -0.07701898 0.72841243
#> 3 HSMD_50 (Intercept) -0.2504580 0.10868797 -0.4634825 -0.03743353 0.12560799
#> 4 HSMD_75 (Intercept) -0.1918735 0.08000593 -0.3486822 -0.03506475 0.04819645
#> avwW I2 n_effects n_studies
#> 1 0.04191511 60.01581 16 16
#> 2 0.04546883 89.56394 16 16
#> 3 0.04186181 61.64808 16 16
#> 4 0.04132897 38.45138 16 16
ex2 <- hsmd(
data = hsmd_example_2,
mT = mT, sdT = sdT, nT = nT,
mC = mC, sdC = sdC, nC = nC,
study = Study
)
#> Warning: Negative means: verify a meaningful ratio-scale origin before interpreting CV-based sensitivity results.
head(ex2$effect_sizes)
#> d vd g vg d25 vd25 g25
#> 1 0.01961060 0.05128452 0.01941643 0.05027401 0.05640465 0.05130245 0.05584619
#> 2 0.25148710 0.01472472 0.25089351 0.01465529 0.22236365 0.01470316 0.22183880
#> 3 0.58686206 0.03247340 0.58346979 0.03209907 0.44725231 0.03192654 0.44466704
#> 4 0.75744489 0.13001630 0.73897062 0.12375138 0.98211539 0.13593793 0.95816136
#> 5 0.63954509 0.07257364 0.63094134 0.07063412 1.11658753 0.07979562 1.10156617
#> 6 0.07976613 0.03004166 0.07931205 0.02970061 0.11808903 0.03006995 0.11741680
#> vg25 d50 vd50 g50 vg50 d75 vd75
#> 1 0.05029158 0.03853757 0.05129157 0.03815601 0.05028092 0.02160971 0.05128504
#> 2 0.01463383 0.15556823 0.01466371 0.15520103 0.01459457 0.09376783 0.01463964
#> 3 0.03155851 0.31282141 0.03153950 0.31101319 0.03117594 0.18838641 0.03130326
#> 4 0.12938768 0.69670406 0.12867802 0.67971128 0.12247759 0.44131633 0.12427444
#> 5 0.07766309 0.79372367 0.07447863 0.78304578 0.07248820 0.50675967 0.07126146
#> 6 0.02972858 0.08116724 0.03004250 0.08070519 0.02970144 0.04629415 0.03002592
#> g75 vg75
#> 1 0.02139575 0.05027453
#> 2 0.09354650 0.01457061
#> 3 0.18729747 0.03094242
#> 4 0.43055252 0.11828620
#> 5 0.49994227 0.06935701
#> 6 0.04603062 0.02968504