| Type: | Package |
| Title: | Meta Analysis Instrumental Variable Estimator |
| Encoding: | UTF-8 |
| Version: | 0.1.10 |
| RoxygenNote: | 7.3.3 |
| URL: | https://meta-analysis.cz/maive/, https://github.com/meta-analysis-es/maive |
| BugReports: | https://github.com/meta-analysis-es/maive/issues |
| Description: | Meta-analysis traditionally assigns more weight to studies with lower standard errors, assuming higher precision. However, in observational research, precision must be estimated and is vulnerable to manipulation, such as p-hacking, to achieve statistical significance. This can lead to spurious precision, invalidating inverse-variance weighting and bias-correction methods like funnel plots. Common methods for addressing publication bias, including selection models, often fail or exacerbate the problem. This package introduces an instrumental variable approach to limit bias caused by spurious precision in meta-analysis. Methods are described in 'Irsova et al.' (2025) <doi:10.1038/s41467-025-63261-0>. |
| License: | MIT + file LICENSE |
| Depends: | R (≥ 4.0.0) |
| Imports: | stats, clubSandwich |
| Suggests: | testthat, knitr, rmarkdown, varhandle |
| VignetteBuilder: | knitr |
| NeedsCompilation: | no |
| Packaged: | 2025-12-02 02:33:36 UTC; runner |
| Author: | Zuzana Irsova [aut] (affiliation: Charles University, Prague), Pedro R. D. Bom [aut] (affiliation: University of Deusto, Bilbao), Tomas Havranek [aut] (affiliation: Charles University, Prague; CEPR, London; METRICS, Stanford), Heiko Rachinger [aut] (affiliation: University of the Balearic Islands, Palma), Petr Cala [aut, cre] (affiliation: Charles University, Prague) |
| Maintainer: | Petr Cala <cala.p@seznam.cz> |
| Repository: | CRAN |
| Date/Publication: | 2025-12-08 08:40:02 UTC |
MAIVE: Meta Analysis Instrumental Variable Estimator
Description
Meta-analysis traditionally assigns more weight to studies with lower standard errors, assuming higher precision. However, in observational research, precision must be estimated and is vulnerable to manipulation, such as p-hacking, to achieve statistical significance. This can lead to spurious precision, invalidating inverse-variance weighting and bias-correction methods like funnel plots. Common methods for addressing publication bias, including selection models, often fail or exacerbate the problem. This package introduces an instrumental variable approach to limit bias caused by spurious precision in meta-analysis. Methods are described in 'Irsova et al.' (2025) doi:10.1038/s41467-025-63261-0.
Author(s)
Maintainer: Petr Cala cala.p@seznam.cz (Charles University, Prague)
Authors:
Zuzana Irsova (Charles University, Prague)
Pedro R. D. Bom (University of Deusto, Bilbao)
Tomas Havranek (Charles University, Prague; CEPR, London; METRICS, Stanford)
Heiko Rachinger (University of the Balearic Islands, Palma)
See Also
Useful links:
Report bugs at https://github.com/meta-analysis-es/maive/issues
Joint Anderson-Rubin CI computation
Description
Computes AR confidence intervals using a 2D grid search over (b0, b1) with chi^2_2 critical value. For the slope (Egger) coefficient under weak instruments, use method = "slope_only" instead.
Usage
compute_AR_CI_optimized(
model,
adjust_fun,
bs,
sebs,
invNs,
g,
type_choice,
weights = NULL,
method = "joint"
)
Arguments
model |
Fitted lm object from second-stage regression |
adjust_fun |
PET_adjust or PEESE_adjust function |
bs |
Effect estimates |
sebs |
Standard errors |
invNs |
Inverse sample sizes (instrument) |
g |
Cluster variable |
type_choice |
CR variance type ("CR0", "CR1", "CR2") |
weights |
Optional weights for weighted AR |
method |
"joint" for 2D grid, "slope_only" for subset AR (robust under weak IV) |
Subset Anderson-Rubin CI for the slope coefficient
Description
Computes weak-instrument-robust AR confidence interval for the slope (Egger) coefficient by treating the intercept as a nuisance parameter.
Usage
compute_AR_CI_slope_only(
model,
adjust_fun,
bs,
sebs,
invNs,
g,
type_choice,
weights = NULL
)
Details
This method is robust under weak instruments and avoids the "banana projection" artifact that can produce spuriously narrow CIs when projecting from 2D joint AR regions.
Algorithm (per tjhavranek, Nov 2025): 1. For each candidate slope b1, form residuals: r_i = y_i - b1 * x_i 2. Run auxiliary regression: r ~ 1 + z (intercept absorbs b0) 3. Use cluster-robust (CR2) variance for the z coefficient 4. Test statistic: t_z^2 from the clustered test 5. Accept b1 if t_z^2 <= qchisq(0.95, df = 1) = 3.84
References: - Guggenberger, P., Kleibergen, F. (2012). Econometrica. - Andrews, D. W. K., & Mikusheva, A. (2016). Econometrica.
R code for MAIVE
Description
R package for MAIVE: "Spurious Precision in Meta-Analysis of Observational Research" by Zuzana Irsova, Pedro Bom, Tomas Havranek, Petr Cala, and Heiko Rachinger.
Usage
maive(dat, method, weight, instrument, studylevel, SE, AR, first_stage = 0L)
Arguments
dat |
Data frame with columns bs, sebs, Ns, study_id (optional). |
method |
1 FAT-PET, 2 PEESE, 3 PET-PEESE, 4 EK. |
weight |
0 no weights, 1 standard weights, 2 MAIVE adjusted weights, 3 study weights. |
instrument |
1 yes, 0 no. |
studylevel |
Correlation at study level: 0 none, 1 fixed effects, 2 cluster. |
SE |
SE estimator: 0 CR0 (Huber-White), 1 CR1 (Standard empirical correction), 2 CR2 (Bias-reduced estimator), 3 wild bootstrap. |
AR |
Anderson Rubin corrected CI for weak instruments (available for unweighted and MAIVE-adjusted weight versions of PET, PEESE, PET-PEESE, not available for fixed effects): 0 no, 1 yes. |
first_stage |
First-stage specification for the variance model: 0 levels, 1 log. |
Details
Data dat can be imported from an Excel file via:
dat <- read_excel("inputdata.xlsx") or from a csv file via: dat <- read.csv("inputdata.csv")
It should contain:
Estimates: bs
Standard errors: sebs
Number of observations: Ns
Optional: study_id
Default option for MAIVE: MAIVE-PET-PEESE, unweighted, instrumented, cluster SE, wild bootstrap, AR.
Value
beta: MAIVE meta-estimate
SE: MAIVE standard error
F-test: heteroskedastic robust F-test of the first step instrumented SEs
beta_standard: point estimate from the method chosen
SE_standard: standard error from the method chosen
Hausman: Hausman type test: comparison between MAIVE and standard version
Chi2: 5
SE_instrumented: instrumented standard errors
AR_CI: Anderson-Rubin confidence interval for weak instruments
pub bias p-value: p-value of test for publication bias / p-hacking based on instrumented FAT
egger_coef: Egger Coefficient (PET estimate)
egger_se: Egger Standard Error (PET standard error)
egger_boot_ci: Confidence interval for the Egger coefficient using the selected resampling scheme
egger_ar_ci: Anderson-Rubin confidence interval for the Egger coefficient (when available)
is_quadratic_fit: Details on quadratic selection and slope behaviour
boot_result: Boot result
slope_coef: Slope coefficient
petpeese_selected: Which model (PET or PEESE) was selected when method=3 (NA otherwise)
peese_se2_coef: Coefficient on SE^2 when PEESE is the final model (NA otherwise)
peese_se2_se: Standard error of the PEESE SE^2 coefficient (NA otherwise)
Examples
dat <- data.frame(
bs = c(0.5, 0.45, 0.55, 0.6),
sebs = c(0.25, 0.2, 0.22, 0.27),
Ns = c(50, 80, 65, 90)
)
result <- maive(dat,
method = 3, weight = 0, instrument = 1,
studylevel = 0, SE = 0, AR = 0, first_stage = 0
)
WAIVE: Weighted Adjusted Instrumental Variable Estimator
Description
WAIVE extends MAIVE by applying exponential-decay weights that downweight studies with spurious precision or extreme outlier behavior.
Usage
waive(dat, method, weight, instrument, studylevel, SE, AR, first_stage = 0L)
Arguments
dat |
Data frame with columns bs, sebs, Ns, study_id (optional). |
method |
1 FAT-PET, 2 PEESE, 3 PET-PEESE, 4 EK. |
weight |
0 no weights, 1 standard weights, 2 MAIVE adjusted weights, 3 study weights. |
instrument |
1 yes, 0 no. |
studylevel |
Correlation at study level: 0 none, 1 fixed effects, 2 cluster. |
SE |
SE estimator: 0 CR0 (Huber-White), 1 CR1 (Standard empirical correction), 2 CR2 (Bias-reduced estimator), 3 wild bootstrap. |
AR |
Anderson Rubin corrected CI for weak instruments (available for unweighted and MAIVE-adjusted weight versions of PET, PEESE, PET-PEESE, not available for fixed effects): 0 no, 1 yes. |
first_stage |
First-stage specification for the variance model: 0 levels, 1 log. |
Details
Computes robust downweighting based on first-stage residuals. Studies with negative residuals (spurious precision) or extreme residuals (outliers) receive reduced influence in the meta-analytic estimate.
Value
List with the same structure as maive(). See ?maive for details.
See Also
Examples
dat <- data.frame(
bs = c(0.5, 0.45, 0.55, 0.6),
sebs = c(0.25, 0.2, 0.22, 0.27),
Ns = c(50, 80, 65, 90)
)
result <- waive(dat,
method = 3, weight = 0, instrument = 1,
studylevel = 0, SE = 0, AR = 0, first_stage = 0
)