Skip to main content
UKPMC Funders Author Manuscripts logoLink to UKPMC Funders Author Manuscripts
. Author manuscript; available in PMC: 2018 Jul 17.
Published in final edited form as: Int J Epidemiol. 2016 Jan 6;45(2):590–591. doi: 10.1093/ije/dyv323

Converting between marginal effect measures from binomial models

Frank Popham 1
PMCID: PMC6049617  EMSID: EMS78381  PMID: 26744485

Dear Editor,

Richardson and colleagues in their excellent paper show an effective method for estimating risk differences and relative risks. Their method uses linear and log binomial generalised linear models (GLMs) with inverse probability weights derived from a treatment model [1]. Adjusting for confounders in a logistic regression outcome model, and reporting the odds ratio, remains common when studying binary outcomes. This is despite calls to report other effect measures given that a conditional odds ratio may differ from an unadjusted odds ratio because of not only confounding but also non-collapsibility [2]. The alternative of estimating risk differences and relative risks using GLMs and directly adjusting for confounders does not always work due to non-convergence, a problem Richardson and colleagues’ method bypasses. Below I show that their treatment model approach to confounder adjustment also solves the problems associated with converting from an odds ratio to a relative risk. A conversion formula has been proposed but has proven inaccurate when working with odds ratios from models directly adjusting for confounding and when converting confidence intervals [3, 4]. This is because the odds ratio used in the formula would be conditional rather than marginal [5]. However, Richardson and colleagues’ approach yields a marginal odds ratio. Although it has been shown the existing conversion formula works with a marginal odds ratio [5], it still may not correctly convert the confidence intervals [6], does not cover the risk and risk difference, and uses a parameter (prevalence in the comparison group) not directly reported by the logistic regression used to obtain the odds ratio. The approach outlined below correctly coverts confidence intervals, covers the other effect measures, takes parameters directly from the logistic regression and covers conversions from other GLMs.

With the Stata syntax in the online supplement I illustrate the method using Richardson and colleagues’ examples, which covered a single binary exposure and the interaction of two binary exposures. To derive the odds ratios I used a logistic regression of outcome and exposure with inverse probability weights from a treatment model. I then converted the odds ratios to relative risks, risk difference and risks using standard relationships between measures (Table 1) and then conducted conversions all other ways (also in Table 1) after fitting the relevant GLM for that effect measure. I used Stata’s “nlcom” command that implements the delta method to convert the confidence intervals to those obtained directly from the relevant GLM [7]. From the GLMs I obtained the same odds ratios (when reported), risks, relative risks and risk differences as the authors did in their paper, with occasional tiny variations when rounding confidence intervals. When converting to other effect measures I achieved the same effect measure as obtained directly using the relevant GLM with tiny variations in the higher decimal places related presumably to numerical precision in the calculations (see supplemental tables 1 and 2).

Table 1.

Converting between effect measures - using standard relationships - estimated from generalised linear models with confounding controlled for by inverse probability weights from a treatment model

Effect measure Convert to
Odds Ratio (OR) Risks in T and C
(RT, RC)*
Risk Difference (RD) Relative Risk (RR)
Odds ratio (OR)* (plus odds in C (OC)) Obtained from model:
OR
RT=OR×OC1+OR×OC
RC=OC1+OC
RD=OR×OC1+OR×OCOC1+OC=OC(OR1)(1+OR×OC)(1+OC) RR=OR×OC1+OR×OC/OC1+OC=OR(1+OC)1+OR×OC

Risks in T and C (RT, RC)** OR=RT1RT/RC1RC Obtained from model:
RT, RC
RD = RTRC RR=RTRC

Risk difference (RD) (plus risk in C (RC)) *** OR=RD+RC1(RD+RC)/RC1RC=RD+RC(1(RD+RC))RC(1(RD+RC)) RT = RD + RC
RC = RC
Obtained from model:
RD
RR=RD+RCRC

Relative risk (RR) (plus risk in C (RC))**** OR=RR×RC1RR×RC/RC1RC=RR(1RC)1RR×RC RT = RR × RC
RC = RC
RD = RR × RCRC Obtained from model:
RR

*T is treatment / exposure level and C is control or comparison group; *from logistic regression; **from linear binomial GLM with no constant / intercept, *** from linear binomial GLM, **** from log binomial GLM

While the formulas are relatively simple, it is admittedly simpler to just obtain the effect measures directly from their relevant GLM. The benefit of the conversion approach comes from reinforcing the relationship between marginal effect measures. This all means that researchers can easily report the adjusted absolute risk in the treatment and control group(s), the relative risk(s) and difference(s) and odds ratio(s) using the inverse probability weighted GLM approach. This bypasses debates around which effect measure should be reported [8], all can be easily obtained. Stata also has an inbuilt approach to inverse probability weighting (“teffects ipw”), the advantage of which is that uncertainty in the treatment model, and not just the outcome model, is incorporated into the standard errors using generalized method of moments estimation [9]. For binary outcomes Stata’s inbuilt approach reports the adjusted risks (potential outcomes means) and risk difference (average treatment effect) as standard outputs from which marginal relative risks and odds ratios can be obtained using the conversion method 10.

Supplementary Material

Supplement

Key messages.

A formula for converting between an adjusted odds ratio and a relative risk has been suggested but may be imprecise with conditional odds ratios.

Inverse probability weighted binomial models as proposed by Richardson and colleagues produce marginal odds ratios making correct conversion possible.

Conversions can be done every way between odds ratios, relative risks, risk differences and adjusted risks with the same results as obtained directly from the relevant model for that effect measure.

A variety of marginal effect measures can be easily reported bypassing debates around which is best.

Acknowledgements

Many thanks to Elise Whitley for commenting on a draft and for simplifying the equations in Table 1.

Funding.

This work is supported by the Medical Research Council, UK and the Chief Scientist Office, Scotland [MC_UU_12017/7] who fund FP’s post. Any views expressed are mine and not those of the funders.

References

  • 1.Richardson DB, Kinlaw AC, MacLehose RF, Cole SR. Standardized binomial models for risk or prevalence ratios and differences. Int J Epidemiol. 2015 doi: 10.1093/ije/dyv137. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 2.Pang M, Kaufman JS, Platt RW. Studying noncollapsibility of the odds ratio with marginal structural and logistic regression models. Stat Methods Med Res. 2013 doi: 10.1177/0962280213505804. [DOI] [PubMed] [Google Scholar]
  • 3.McNutt L-A, Wu C, Xue X, Hafner JP. Estimating the Relative Risk in Cohort Studies and Clinical Trials of Common Outcomes. Am J Epidemiol. 2003;157:940–3. doi: 10.1093/aje/kwg074. [DOI] [PubMed] [Google Scholar]
  • 4.McNutt L, Hafner J, Xue X. Correcting the odds ratio in cohort studies of common outcomes. JAMA. 1999;282:529. doi: 10.1001/jama.282.6.529. [DOI] [PubMed] [Google Scholar]
  • 5.Karp I. Re: “Estimating the Relative Risk in Cohort Studies and Clinical Trials of Common Outcomes”. Am J Epidemiol. 2014;179:1034–5. doi: 10.1093/aje/kwt435. [DOI] [PubMed] [Google Scholar]
  • 6.McNutt L-A, Wu C, Xue X, Hafner J-P. The Authors Reply. Am J Epidemiol. 2014;179:1035–1036. doi: 10.1093/aje/kwt438. [DOI] [PubMed] [Google Scholar]
  • 7.Localio AR, Margolis DJ, Berlin JA. Relative risks and confidence intervals were easily computed indirectly from multivariable logistic regression. J Clin Epidemiol. 2007;60:874–82. doi: 10.1016/j.jclinepi.2006.12.001. [DOI] [PubMed] [Google Scholar]
  • 8.Cummings P. The Relative Merits of Risk Ratios and Odds Ratios. Archives of Pediatrics Adolescent Medicine. 2009;163:438–45. doi: 10.1001/archpediatrics.2009.31. [DOI] [PubMed] [Google Scholar]
  • 9.Drukker D. Using gmm to solve two-step estimation problems. The Stata Blog Not elsewhere classified. 2014 http://blog.stata.com/2014/12/08/using-gmm-to-solve-two-step-estimation-problems/
  • 10.Bartlett J. Estimating risk ratios from observational data in Stata. The Stats Geek. 2015 http://thestatsgeek.com/2015/03/09/estimating-risk-ratios-from-observational-data-in-stata/

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Supplement

RESOURCES