Skip to contents

Describe numeric and categorical effect modifiers to support substantive assessment of transitivity. This function does not test transitivity.

Usage

network_transitivity(data, study_id, treatment_1, treatment_2, modifiers)

Arguments

data

Contrast data containing study IDs, treatment labels and modifiers.

study_id, treatment_1, treatment_2

Study and treatment column names.

modifiers

Numeric or categorical modifier column names. Encode numeric category codes as factors if categorical summaries are intended.

Value

A data frame containing comparison, modifier, type, category, studies, observed, mean, sd, min, max, and proportion. Numeric rows have missing category/proportion; categorical rows have missing numeric summary fields. studies is repeated across category rows.

Details

Treatment pairs are labelled without regard to contrast direction. For each modifier separately, identical study/comparison/value combinations are counted once. Different values within the same study and comparison remain distinct. The function summarizes supplied comparison rows; it does not reconstruct unreported or implied multi-arm comparisons.

For numeric modifiers, retain finite values and calculate the arithmetic mean, sample SD and range. observed counts finite deduplicated values; studies counts unique studies in that comparison, including those without a finite modifier. Means/ranges are missing if no finite values remain; SD is missing with fewer than two values. These are observation summaries, not sample-size-weighted means.

For nonnumeric modifiers, each observed category has a row. Missing values form an additional category labelled NA. observed is its count and proportion is that count divided by all deduplicated values, including missing values. Categories absent from a comparison are not added as zero-count rows. When a study has different values, proportions need not equal proportions of studies.

Compare distributions across treatment comparisons with clinical knowledge of which variables modify relative effects. Differences in age, severity, follow-up, intervention definitions or risk of bias can motivate further investigation or prespecified meta-regression. Similar summaries cannot exclude unmeasured effect modification; differing summaries alone do not demonstrate statistical incoherence. Large amounts of missing modifier information weaken the assessment.

Examples

 d <- data.frame(study=1:4,a="A",b=c("B","B","C","C"),
   age=c(30,40,50,60),risk=c("low","high","low",NA))
 network_transitivity(d,"study","a","b",c("age","risk"))
#>  comparison modifier        type category studies observed       mean        sd
#>      A vs B      age     numeric     <NA>       2        2 35.0000000 7.0710678
#>      A vs C      age     numeric     <NA>       2        2 55.0000000 7.0710678
#>      A vs B     risk categorical     high       2        1         NA        NA
#>      A vs B     risk categorical      low       2        1         NA        NA
#>      A vs C     risk categorical      low       2        1         NA        NA
#>      A vs C     risk categorical     <NA>       2        1         NA        NA
#>         min        max proportion
#>  30.0000000 40.0000000         NA
#>  50.0000000 60.0000000         NA
#>          NA         NA  0.5000000
#>          NA         NA  0.5000000
#>          NA         NA  0.5000000
#>          NA         NA  0.5000000