
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() using univariate random-effects models, so
the workflow depends only on base R and package internals.
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.
- 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).- estimation_method
Estimation method passed to
mars(), either"REML"or"MLE".- x
An object of class
"hsmd".- digits
Number of digits used when printing numeric results.
- ...
Additional arguments passed to downstream print methods.
Value
A list with class "hsmd" containing:
- summary
Data frame of pooled SMD and HSMD results.
- effect_sizes
Data frame of study-level effect sizes and variances.
- data
Original input data with added coefficient-of-variation and harmonized SD columns.
- models
Named list of fitted
marsmodel objects.- quantiles
Named numeric vector of the requested harmonization quantiles.
Examples
ex1 <- hsmd(
data = hsmd_example_1,
mT = mT, sdT = sdT, nT = nT,
mC = mC, sdC = sdC, nC = nC,
study = Study
)
ex1$summary
#> method est se ci.lb ci.ub tau2 avwW
#> 1 SMD -0.3060830 0.10640132 -0.5146258 -0.09754029 0.11743966 0.04191511
#> 2 HSMD_25 -0.4778418 0.22512747 -0.9190835 -0.03660002 0.72841275 0.04546883
#> 3 HSMD_50 -0.1789429 0.10868797 -0.3919674 0.03408160 0.12560800 0.04186181
#> 4 HSMD_75 -0.1105698 0.08000593 -0.2673785 0.04623900 0.04819645 0.04132897
#> I2
#> 1 60.01581
#> 2 89.56395
#> 3 61.64808
#> 4 38.45138
ex2 <- hsmd(
data = hsmd_example_2,
mT = mT, sdT = sdT, nT = nT,
mC = mC, sdC = sdC, nC = nC,
study = Study
)
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