
Trim-and-Fill Sensitivity Analysis
trim_fill.RdIteratively trims asymmetric extreme studies, estimates a symmetry center, reflects their effects to impute studies and refits the augmented meta-analysis. Implemented using base R; no additional runtime package is required.
Arguments
- object
Intercept-only univariate mars fit with one independent effect per study, or pub_bias fit whose ordinary parent is used. Moderator, multilevel, multivariate, scale-location, network and penalized models are unsupported.
- side
auto, left or right: the side on which studies are imputed. auto fits a raw-effect meta-regression on sampling SE with the parent's ML/REML covariance convention; negative SE slope chooses right, otherwise left. This is data-driven and is not an Egger significance test. Prespecifying a scientifically meaningful side and checking both directions is preferable.
- estimator
Missing-study rank estimator: L0 (default), R0 or Q0.
- maxiter
Positive integer maximum number of trim/refit iterations.
- tol
Numerical tolerance in (0,1) for scalar heterogeneity optimization.
- level
Confidence level in (0,1) for conventional normal-reference intervals.
- x
Trim-and-fill result.
- digits
Significant digits for printing.
- ...
Unsupported print arguments are rejected.
Value
A mars_trimfill object with n_imputed, side, estimator, original and
adjusted estimate/SE/tau2/interval summaries, reflection_center, iteration
history, augmented data, source-row links and diagnostics. Filled records have
imputed=TRUE and retain the sampling variance of their reflected source study.
The ordinary parent is unchanged. funnel_plot() distinguishes filled points.
Details
For n observed studies, orient effects so the candidate missing side is left, and sort ascending. At each iteration refit after excluding the current number of largest effects. Rank absolute deviations from that center using sequential ranks for ties; signed ranks use the deviation sign. If \(T\) is the sum of positive signed ranks and \(r_-\) the largest absolute negative rank, the estimates are \(L_0=(4T-n(n+1))/(2n-1)\), \(R_0=n-r_{-}-1\), and \(Q_0=n-1/2-\sqrt{2n^2-4T+1/4}\). Round to the nearest integer and truncate at zero. An all-zero-deviation configuration yields zero. Stop when the estimated count stabilizes. Negative Q0 radicands, fewer than two retained studies, cycles or iteration exhaustion are errors, not successful adjustments. At least three input studies are required. Reflect the largest n_imputed effects around the converged trimmed center, restore their original direction and refit all observed and filled data. Observed records keep their input order. Ties follow sorted effect order.
Each trimmed and augmented fit re-estimates constant heterogeneity by the parent's ML or REML method. REML adds \(\log|X'V^{-1}X|\) to the concentrated normal deviance; ML omits it. Scalar optimization compares an exact \(\tau^2=0\) boundary. A parent fixed \(\tau^2\) is held fixed, including zero. Parent robust inference does not transfer to imputed studies: displayed intervals are conventional normal intervals conditional on the augmented data, omitting uncertainty in the missing-study count and imputation. Both original and augmented summaries use inverse-variance mean SEs, \(1/\sqrt{\sum_i 1/(v_i+\tau^2)}\), rather than copying parent joint-Hessian or robust SEs; their intervals can differ from summary(parent). No missing-count SE or bias-test p-value is reported. L0, R0 and Q0 can produce materially different sensitivity results.
Filled points are hypothetical studies under funnel symmetry, not recovered unpublished observations or a verified count of missing studies. Heterogeneity, effect-SE coupling, direction choice and rank ties can affect the result. Sequential tie ranks can give positive fills even for exactly symmetric paired data; that count is not proof of missing studies. Zero imputed studies does not exclude publication bias. The algorithm follows the Duval–Tweedie rank/reflection construction; matched ML/REML, side and estimator settings can be compared with metafor::trimfill().
References
Duval and Tweedie (2000). Trim and fill: A simple funnel-plot-based method of testing and adjusting for publication bias in meta-analysis. Biometrics, 56, 455-463. doi:10.1111/j.0006-341X.2000.00455.x .
Examples
fit <- mars(bcg,studyID="trial",effectID=NULL,sample_size=NULL,formula=yi~1,
variance="vi",varcov_type="univariate",structure="univariate")
sensitivity <- trim_fill(fit,side="left")
sensitivity
#> Trim-and-fill sensitivity analysis
#> Estimator: L0 | Imputed side: left | Hypothetical studies: 0
#> estimate SE tau2 lower upper
#> original -0.7145 0.1798 0.3132 -1.067 -0.3622
#> augmented -0.7145 0.1798 0.3132 -1.067 -0.3622
#> Intervals condition on augmented data and omit imputation uncertainty.
funnel_plot(fit,trim_fill=TRUE,trim_fill_args=list(side="left"))