ml_sens: Time-Varying Sensitivity Analysis via Longitudinal ITCV

View source: R/ml_sens.R

ml_sensR Documentation

Time-Varying Sensitivity Analysis via Longitudinal ITCV

Description

Computes the Impact Threshold for a Confounding Variable (ITCV) at each follow-up time point using the pooled estimates and robust inference from ml_meta(). Two versions are returned: the raw ITCV (threshold to nullify the pooled effect) and the significance-adjusted ITCV_alpha (threshold to render the result non-significant under small-sample-corrected inference).

Usage

ml_sens(data, meta_obj, yi, vi, study, time, alpha = NULL, delta = 0.15)

Arguments

data

A data.frame in long format (same as passed to ml_meta()).

meta_obj

Output from ml_meta().

yi, vi, study, time

Column names (same meaning as in ml_meta()).

alpha

Significance level. Defaults to the value stored in meta_obj (or 0.05 if absent).

delta

Numeric. User-defined practical fragility benchmark: time points with ITCV_alpha(t) < delta are flagged as "practically fragile". Default 0.15.

Value

An object of class ml_sens (a data.frame) with columns:

time

Follow-up time.

theta, se, df

Copied from meta_obj.

sy

Weighted SD of observed effect sizes.

r_effect

Pooled effect on correlation scale.

itcv

Raw ITCV: confounding needed to nullify the estimate.

itcv_alpha

Significance-adjusted ITCV: confounding needed to make the result non-significant.

fragile

Logical; TRUE when itcv_alpha < delta.

Attributes include trajectory summaries (itcv_min, itcv_mean, fragile_prop) and a "fragile_times" character vector.

Mathematical background

At each time t, let \hat\theta_t be the pooled effect, s_{y,t}^2 the weighted variance of observed effect sizes, and c_t = t_{1-\alpha/2,\nu_t} \cdot \widehat{SE}(\hat\theta_t) the minimum effect still deemed significant. The correlation-scale pooled effect is

r_t = \hat\theta_t / \sqrt{\hat\theta_t^2 + s_{y,t}^2}

and the raw ITCV is \sqrt{|r_t|}. The significance-adjusted version replaces \hat\theta_t with |\hat\theta_t| - c_t.

References

Frank, K. A. (2000). Impact of a confounding variable on a regression coefficient. Sociological Methods & Research, 29(2), 147-194.

See Also

ml_meta(), ml_benchmark(), ml_plot()

Examples

dat  <- sim_longitudinal_meta(k = 10, times = c(0, 6, 12), seed = 1)
meta <- ml_meta(dat, yi = "yi", vi = "vi", study = "study", time = "time")
sens <- ml_sens(dat, meta, yi = "yi", vi = "vi", study = "study", time = "time")
print(sens)
plot(sens)


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