Meta-Analysis in Stata: A Practical Guide with Case Studies on Continuous and Dichotomous Data

Part A: Meta Analysis for Continuous Data:
Case Study 1:
Research Question
Does physical activity improve self-esteem in adolescents compared to no intervention?
Data:
Study ID | Sample Size (Exercise Group) | Mean Self-Esteem (Exercise Group) | SD (Exercise Group) | Sample Size (Control Group) | Mean Self-Esteem (Control Group) | SD (Control Group) |
Study 1 | 60 | 31.2 | 5.5 | 60 | 27.8 | 5.6 |
Study 2 | 75 | 32.5 | 6 | 75 | 29 | 6.2 |
Study 3 | 50 | 30.4 | 5.2 | 50 | 27.5 | 5.5 |
Study 4 | 80 | 33 | 5.8 | 80 | 29.5 | 6 |
Study 5 | 65 | 31.8 | 5.6 | 65 | 28.6 | 5.7 |
Study 6 | 90 | 34 | 6.1 | 90 | 30 | 6.4 |
Study 7 | 55 | 30.5 | 5.9 | 55 | 27.2 | 6 |
Study 8 | 100 | 33.8 | 6.3 | 100 | 29.9 | 6.6 |
Study 9 | 70 | 32 | 5.7 | 70 | 28.5 | 5.9 |
Study 10 | 85 | 33.1 | 6.2 | 85 | 29.6 | 6.5 |
Data Description:
The dataset includes summary statistics from 10 studies comparing self-esteem scores between exercise and control groups, each providing sample size, mean, and standard deviation.
Step by Step Meta Analysis for Continuous data in Stata:
Step 1: Import data in Stata

Data View in Stata:

Step 2: Click on Statistics menu, select Meta-Analysis, Select Setup then click on Compute and declare effect sizes for two group Comparison of Continuous Outcome then define study variables and Effect size Method and Click on Submit.

Step 3: Click on Forest Plot to generate the visual summary of individual and pooled study effects and Click on Submit.

Forest Plot:

Interpretation:
All studies show positive SMDs (0.54 to 0.64), indicating a consistent moderate effect of physical activity on adolescent self-esteem. None of the 95% confidence intervals include zero, meaning each effect is statistically significant. The overall pooled SMD is 0.59 [95% CI: 0.48, 0.69], confirming a moderate and reliable benefit. Heterogeneity is absent (τ² = 0.00, I² = 0.00%, H² = 1.00; Q(9) = 0.31, p = 1.00), suggesting highly consistent results across studies. The pooled effect is statistically significant (z = 10.98, p = 0.00), providing strong evidence that physical activity improves self-esteem in adolescents.
Step 4: Publication Bias under the Meta-Analysis menu and click on Funnel Plot for Graphical Diagnostic of Small Study Effect to visually assess bias or asymmetry.

Funnel Plot:

Interpretation:
The Funnel Plot Seems Symmetrical Suggest No Publication Bias.
Step 5: To Perform Egger’s Test, Click on test for small-study effects in Meta Analysis under the Publication Bias section.

Eggers Test Hypothesis:
Null Hypothesis (H₀):
There is no funnel plot asymmetry — the effect sizes are not related to their standard errors.
This implies no publication bias or small-study effects.
Alternative Hypothesis (H₁):
There is funnel plot asymmetry — the effect sizes are related to their standard errors.
This suggests potential publication bias or small-study effects.
Stata Output Eggers Test:
Regression-based Egger test for small-study effects
Random-effects model
Method: REML
H0: beta1 = 0; no small-study effects beta1 = -0.84 SE of beta1 = 3.059 z = -0.27 Prob > |z| = 0.7845Interpretation:
Since the p-value is 0.7845 (greater than 0.05), we fail to reject the null hypothesis.
This means there is no statistical evidence of funnel plot asymmetry, and hence no indication of publication bias in the meta-analysis.
Part B: Meta Analysis for Dichotomous Data:
Case Study 2:
Research Question:
Does Drug A reduce the risk of infection compared to Placebo?
Data
Study ID | Drug A Events | Drug A No Events | Drug A Total | Placebo Events | Placebo No Events | Placebo Total |
Study 1 | 12 | 90 | 102 | 25 | 79 | 104 |
Study 2 | 18 | 84 | 102 | 30 | 73 | 103 |
Study 3 | 10 | 90 | 100 | 20 | 80 | 100 |
Study 4 | 8 | 94 | 102 | 16 | 86 | 102 |
Study 5 | 20 | 82 | 102 | 35 | 70 | 105 |
Study 6 | 15 | 85 | 100 | 28 | 78 | 106 |
Study 7 | 17 | 85 | 102 | 33 | 68 | 101 |
Study 8 | 13 | 89 | 102 | 27 | 80 | 107 |
Study 9 | 19 | 70 | 89 | 31 | 70 | 101 |
Study 10 | 14 | 86 | 100 | 26 | 80 | 106 |
Data Description:
The dataset includes results from 10 studies comparing infection rates between patients receiving Drug A and those receiving a placebo. Each study reports the number of infection events and non-events in both groups as well as Total enabling the calculation of risk Differences.
Step by Step Meta Analysis for Dichotomous Data in Stata:
Step 1: Import data in Stata

Data View in Stata:

Step 2: Click on Statistics menu, select Meta-Analysis, Select Setup then click on Compute and declare effect sizes for two group Comparison of Binary Outcome then define study variables and Effect size Method and Click on Submit.

Step 3: Click on Forest Plot to generate the visual summary of individual and pooled study effects and Click on Submit.

Forest Plot:

Interpretation:
The meta-analysis shows a pooled risk difference of -0.11 [95% CI: -0.15, -0.08], indicating that the Drug A reduces risk by 11% compared to control. Most studies report negative risk differences, and many confidence intervals do not cross zero, suggesting statistically significant effects. Heterogeneity is negligible (τ² = 0.00, I² = 0.01%, H² = 1.00), indicating high consistency across studies. The Q-test (Q(9) = 1.65, p = 1.00) supports the absence of significant heterogeneity. The overall effect is statistically significant (z = -6.53, p = 0.00), providing strong evidence that the Drug A is effective in reducing the risk of infection compared to Placebo.
Step 4: Publication Bias under the Meta-Analysis menu and click on Funnel Plot for Graphical Diagnostic of Small Study Effect to visually assess bias or asymmetry.

Funnel Plot:

Interpretation:
The Funnel Plot Seems Symmetrical Suggest No Publication Bias
Step 5: To Perform Egger’s Test, Click on test for small-study effects in Meta Analysis under the Publication Bias section.

Eggers Test Hypothesis:
Null Hypothesis (H₀):
There is no funnel plot asymmetry — the effect sizes are not related to their standard errors.
This implies no publication bias or small-study effects.
Alternative Hypothesis (H₁):
There is funnel plot asymmetry — the effect sizes are related to their standard errors.
This suggests potential publication bias or small-study effects.
Stata Output Eggers Test:
Regression-based Egger test for small-study effects
Random-effects model
Method: REML
H0: beta1 = 0; no small-study effects beta1 = -2.52[latex]</p> <p> [latex]SE of beta1 = 3.199 z = -0.79 Prob > |z| = 0.4307Interpretation:
Since the p-value is 0.4307 (greater than 0.05), we fail to reject the null hypothesis.
This means there is no statistical evidence of funnel plot asymmetry, and hence no indication of publication bias in the meta-analysis.