ml_fragility: Leave-One-Out and Leave-k-Out Fragility Analysis

View source: R/ml_fragility.R

ml_fragilityR Documentation

Leave-One-Out and Leave-k-Out Fragility Analysis

Description

Computes fragility indices for each time point by systematically removing studies and re-estimating the pooled effect. The fragility index at time t is the minimum number of studies whose removal changes the statistical conclusion (significant -> non-significant or vice versa).

Usage

ml_fragility(
  data,
  meta_obj,
  yi,
  vi,
  study,
  time,
  max_k = 5L,
  max_combinations = 500L,
  alpha = NULL,
  rho = 0.8,
  small_sample = TRUE,
  seed = NULL
)

Arguments

data

Long-format data.frame.

meta_obj

Output from ml_meta().

yi, vi, study, time

Column names.

max_k

Maximum number of studies to remove. Default 5.

max_combinations

Maximum number of combinations to test per k. Default 500. Larger values are more exhaustive but slower.

alpha

Significance level.

rho

Working correlation.

small_sample

Use CR2 + Satterthwaite?

seed

Random seed for sampling combinations. Default NULL.

Details

At each time point, studies are removed one at a time (or in combinations for the leave-k-out version) and the model is re-fit. The fragility index is the smallest k such that removing any set of k studies flips the significance of the pooled estimate. A fragility index of 1 means a single study's removal changes the conclusion.

For the leave-k-out version, a random sample of combinations is used when the number of combinations is large (controlled by max_combinations).

Value

Object of class ml_fragility (a data.frame) with columns:

time

Follow-up time.

k_studies

Number of studies at this time point.

p_original

Original p-value.

sig_original

Was the original result significant?

fragility_index

Min number of removals to flip significance. NA if not found within max_k.

fragility_quotient

fragility_index / k_studies (proportion).

study_removed

Study ID whose removal achieved the flip (leave-one-out only).

Examples


dat  <- sim_longitudinal_meta(k = 10, times = c(0, 6, 12), seed = 5)
meta <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time")
frag <- ml_fragility(dat, meta, yi = "yi", vi = "vi",
                      study = "study", time = "time",
                      max_k = 1L, seed = 1)
print(frag)



metaLong documentation built on March 31, 2026, 1:07 a.m.