Skip to contents

Uses a joint first-order delta method under multivariate normal measurements, independent randomized arms, and fixed sample sizes. Sampling covariance includes both numerator and estimated-denominator uncertainty. This is an approximation, not an exact finite-sample covariance formula. Pair-pooled SDs assume a common population SD for interpretation on an additive network scale; unequal population SDs can violate that interpretation. A control SD is tied to the chosen baseline.

Usage

network_smd_data(
  data,
  study_id,
  treatment,
  mean,
  sd,
  n,
  outcome = NULL,
  time = NULL,
  arm_observation_id = NULL,
  standardizer = c("pair_pooled", "study_pooled", "control_sd"),
  correction = TRUE,
  correlations = NULL,
  overlap = NULL,
  assume_independent = FALSE,
  all_contrasts = FALSE
)

Arguments

data

Arm-level data, one row per study/treatment/outcome/time.

study_id, treatment, mean, sd, n

Column names for study, arm, mean, SD, and size.

outcome, time

Optional measurement columns.

arm_observation_id

Unique row ID column; defaults to row numbers.

standardizer

pair_pooled, study_pooled (within outcome/time), or control_sd (the first arm of each returned contrast).

correction

Apply the exact gamma-ratio Hedges correction using the denominator degrees of freedom. The resulting sampling covariance remains a delta-method approximation.

correlations

Named study matrices of individual-level correlations, dimension names matching arm observation IDs. Required for repeated measurements unless assume_independent=TRUE. Different arms must have zero correlation.

overlap

Named study matrices of participant overlap counts. Required for correlated measurements with unequal sample sizes. With equal sizes and supplied correlations, omitted overlap means the same participants were measured.

assume_independent

Explicitly assume independence for different measurement rows when correlations are unavailable.

all_contrasts

Return every pair instead of baseline contrasts. Such rows can be redundant; the estimator rejects singular sampling covariance.

Value

A list with data, named sampling_covariance study blocks, and metadata. Use the returned observation_id column when fitting.

Examples

arms <- data.frame(study = 1, treatment = c("A", "B", "C"),
                   m = c(10, 12, 13), s = c(3, 4, 3), n = c(25, 30, 28))

network_smd_data(arms, "study", "treatment", "m", "s", "n",
                 assume_independent = TRUE)
#> $data
#>   study_id treatment_1 treatment_2    effect outcome    time denominator_df
#> 1        1           A           B 0.5504139 overall overall             53
#> 2        1           A           C 0.9852095 overall overall             51
#>   hedges_correction standardizer_sd observation_id   variance
#> 1         0.9857707        3.581925           1::1 0.07072892
#> 2         0.9852095        3.000000           1::2 0.08300720
#> 
#> $sampling_covariance
#> $sampling_covariance$`1`
#>            1::1       1::2
#> 1::1 0.07072892 0.03422512
#> 1::2 0.03422512 0.08300720
#> 
#> 
#> $metadata
#> $metadata$metric
#> [1] "Hedges g"
#> 
#> $metadata$standardizer
#> [1] "pair_pooled"
#> 
#> $metadata$covariance
#> [1] "joint normal-summary delta method"
#> 
#> $metadata$correlations
#> NULL
#> 
#> $metadata$overlap
#> NULL
#> 
#> $metadata$assume_independent
#> [1] TRUE
#> 
#> $metadata$overlap_default
#> [1] "Same participants for correlated equal-size measurements"
#> 
#> $metadata$coherence
#> [1] "Requires scientifically comparable standardizers and outcome/time definitions"
#> 
#>