Many meta‐analyses use a random‐effects model to account for heterogeneity among study results, beyond the variation associated with fixed effects. A random‐effects regression approach for the synthesis of 2 × 2 tables allows the inclusion of covariates that may explain heterogeneity. A simulation study found that the random‐effects regression method performs well in the context of a meta‐analysis of the efficacy of a vaccine for the prevention of tuberculosis, where certain factors are thought to modify vaccine efficacy. A smoothed estimator of the within‐study variances produced less bias in the estimated regression coefficients. The method provided very good power for detecting a non‐zero intercept term (representing overall treatment efficacy) but low power for detecting a weak covariate in a meta‐analysis of 10 studies. We illustrate the model by exploring the relationship between vaccine efficacy and one factor thought to modify efficacy. The model also applies to the meta‐analysis of continuous outcomes when covariates are present.