如何让meta.summaries用置信区间上下限或让epi.2by2生成标准误?
meta.summaries when you only have confidence intervals from epi.2by2 Great question—you're right that meta.summaries expects standard errors, but we have two straightforward ways to fix this: either calculate SE from your existing CI bounds, or pull the SE directly from epi.2by2's output (since it already computes it under the hood!).
Option 1: Calculate standard error from confidence interval bounds
Since relative risk (RR) confidence intervals are computed on the log scale (to account for the skewed distribution of RR), we'll work there to reverse-engineer the SE:
- First, take the natural log of your RR, lower CI bound, and upper CI bound.
- Use the formula for CI width on the normal scale to solve for SE:
# Assuming your DATA has columns: RR, lower_CI, upper_CI DATA$log_RR <- log(DATA$RR) DATA$log_lower <- log(DATA$lower_CI) DATA$log_upper <- log(DATA$upper_CI) # For 95% CI, z-score is ~1.96 (qnorm(0.975)) DATA$SE_log_RR <- (DATA$log_upper - DATA$log_lower) / (2 * qnorm(0.975)) - Now pass the log-transformed RR and its SE to
meta.summaries, then exponentiate the results to get back to the original RR scale:m_log <- meta.summaries(DATA$log_RR, DATA$SE_log_RR) m_summary <- summary(m_log, conf.level = 0.95) # Convert back to RR scale pooled_RR <- exp(m_summary$coef[1]) pooled_CI <- exp(m_summary$coef[2:3])
Option 2: Extract standard error directly from epi.2by2
You don't need to reinvent the wheel—epi.2by2 already calculates the log-scale SE for RR in its output. When you run epi.2by2, the returned object includes a measure list with log.rr.se (the SE of the log-transformed RR).
Here's how to use it:
# Example: if you have a list of epi.2by2 results (one per study) # Replace this with your actual epi.2by2 output workflow study_results <- lapply(your_study_data, function(dat) { epi.2by2(dat = dat, method = "cohort", conf.level = 0.95) }) # Extract log RR and its SE from each result log_RR_values <- sapply(study_results, function(x) x$measure$log.rr) SE_values <- sapply(study_results, function(x) x$measure$log.rr.se) # Run meta.summaries as usual m <- meta.summaries(log_RR_values, SE_values) summary(m, conf.level = 0.95)
Quick Note
Always remember that meta-analysis for RR (or OR) should be done on the log scale to meet the normality assumption required by meta.summaries. Exponentiating the final pooled estimate and confidence interval will give you the interpretable original-scale values.
内容的提问来源于stack exchange,提问作者Alistair Rice

