Confidence Intervals for Adjusted Proportions Using Logistic Regression

This paper presents confidence intervals for adjusted proportions using logistic regression with weighted sum contrasts. The methods are applied to data from two studies, (1) imposex percentages among female gastropods at different locations in the Gulf of Thailand adjusted for different species, and (2) complication-based neonatal morbidity risk for births at a major hospital adjusted for demographic factors.


Introduction
Odds ratios are conventionally used for assessing associations between binary outcomes and categorical risk factors.They are often preferred in scientific studies because they give valid confidence intervals for these associations for case-control studies as well as for cohort studies and cross-sectional studies (Fernandez et al., 1999;Lim & Tongkumchum, 2009;Peters et al., 2000).A further advantage is that methods such as Mantel-Haenszel adjustment and logistic regression are available for adjusting odds ratios for confounding bias arising from covariates associated with both the binary outcome and the risk factor of interest.These issues are discussed in detail in the biostatistical literature (see, for example, McNeil, 1996;Woodward, 1999).
For cohort and cross-sectional studies where the proportions or percentages of an adverse outcome are of primary interest, it is also important to give confidence intervals for comparing these proportions.If there are no covariates of interest, these confidence intervals can be computed, either directly from the observed proportions with some adjustment such as an arcsine transformation to ensure that the confidence intervals are between 0 and 1 (see, for example, Armitage & Berry, 1994) using a logistic regression model.However, the situation is more complicated when adjustments for covariates are required, and methods for constructing such confidence intervals are not routinely provided in statistical packages.
In this paper we describe a general method for computing confidence intervals for comparing several proportions after adjusting for categorical covariates.The method is illustrated using two recently published applications of scientific interest: imposex among female gastropods in the Gulf of Thailand (Swennen, Sampantarak, & Rattanadakul, 2009), and complication-based neonatal morbidity risk among babies at a major hospital in southern Thailand (Rachatapantanakorn & Tongkumchum, 2009).

Logistic Regression
Logistic regression (Hosmer & Lemeshow, 2000;Kleinbaum & Klein, 2002) is a statistical method widely used to model the association between a binary outcome probability -the probability of a specific outcome -and a set of fixed determinants.When the determinants are categorical factors, these factors can be structured as a multi-way contingency table of counts and the data for analysis comprise the proportions of adverse outcomes in the cells of this table.If, for example, the outcome variable Y takes values 0 and 1 (adverse outcome) and there are two factors with levels indexed by i and j, respectively, the model takes the form ( ) . (1) Note that if r and c are the numbers of factor levels specified in the model by the sets of parameters {α} and {β}, the number of independent parameters is r + c -1, so it is necessary to put a constraint on these parameters when fitting the model.This constraint is conventionally achieved by replacing α i + β j in the model by μ + α i + β j where α 1 = 0 and β 1 = 0, in which case the model is written as ( ) (2) This model provides estimates of odds ratios for comparing the outcome probabilities with respect to specified levels of each factor.Thus exp(α i ) is the ratio of the odds of an adverse outcome for level i to that for level 1 for the first factor, whereas exp(β j ) is the ratio of the odds of an adverse outcome for level j to that for level 1 for the second factor.Thus each odds ratio in this model uses the first level of each factor as a baseline.To obtain odds ratios with respect to another baseline level, the data would need to be recoded so that the new baseline is constrained to take the value 0.
Under appropriate conditions on the pattern of zeros in the data (see, for example, Section 7.2 of Venables & Ripley, 2002), this logistic regression model is fitted using maximum likelihood and the results include estimates of the parameters and their standard errors, from which confidence intervals can be plotted.

Contrasts
When the constraints α 1 = 0 and β 1 = 0 are used in the logistic regression model ( 2) the confidence intervals apply to the differences between each of the sets of parameters and the first parameter specified in each factor.These differences are known as treatment contrasts.In practice, it is often preferable not to single out a specific level of a factor as a basis for comparison, but rather to treat all factor levels in the same way.For linear models of the form standard errors of these differences are obtained by using the standard sum contrasts available in commonly used software packages such as R program (R Development Core Team, 2007).However, as pointed out by Venables and Ripley (2002), these contrasts are not valid for unbalanced designs, which include logistic regression models.Thus it is necessary to construct specific contrasts for logistic regression, and this can be accomplished by using weighted sum contrasts rather than treatment contrasts (Tongkumchum & McNeil, 2009).These weighted sum contrasts provide standard errors for the differences between each factor level and their overall mean.

Adjustment for Covariates
The method is analogous to that commonly used by linear regression analysis for adjusting outcomes to reduce the effects of covariate factors, such as seasonal adjustment of unemployment rates.In this case, if {β} represents the primary factor of interest and {α} the covariate factor, and ε ij are independent errors with mean zero and common standard deviation, the model is given by Equation (3).The factors {α} and {β} in this model are estimated as the row and column means of the data matrix y ij , with a suitable constraint to ensure identifiability.To adjust for the covariate, the adjusted mean for level j of the primary factor is obtained by first removing the effect of the covariate from each observation by replacing y ij by i ij y α − and then adding a constant to ensure that the mean of the corrected observations remains the same as the mean of the original observations.As a result, the adjusted mean is d y j j + = β ˆ, where d is a constant chosen to ensure that the overall mean before and after the adjustment remains the same.It follows that , where β is the mean of the estimated β parameters.
Similarly, the formula for adjusting the proportion for level j of a primary factor is ( ) (4) Note that this result follows from the fact that the estimate given by logistic regression for the adjusted odds ratio for level j compared to level 1 is ) êxp( j β and this must equate to The constant d may be chosen to ensure that the overall proportion (or the total number N) of adverse outcomes before and after the adjustment is the same, that is (5) Substituting Equation (4) into Equation ( 5), it follows that d must satisfy the equation Equation ( 6) is non-linear and cannot be solved explicitly to give an expression for the constant d.However, it can be solved using the Newton-Raphson iterative procedure with Marquardt damping to ensure convergence.Note that this method extends straightforwardly to any number of covariate factors.

Imposex among gastropods in the Gulf of Thailand
Female gastropods were collected from 56 sampling sites grouped into 13 areas around the Gulf of Thailand in 2006 (Swennen et al., 2009) and tested for imposex.Since different species have different sensitivities to be imposex and this variation could bias the estimation of imposex prevalence due to the fact that different species are found in different locations, it was necessary to take both factors (16 species groups and 13 areas) into account.The logistic regression model (Equation 2) was fitted to the data.Figure 1 shows plots of 95% confidence intervals for the proportions.
The overall imposex percentage was 25.2, indicated by the vertical lines in Figure 1.Although there were 208 (13 areas × 16 species groups) cells in the data table, 124 of these cells contained no data because relatively for species groups were found in each area.Thus the number of degrees of freedom after fitting the two-factor model was reduced from 71 (84 -13) to 56 (84 -13 -15).
Figure 1 indicates that the crude percentages overestimated the true values in the Pattaya area and underestimated them in the Tak Bai, Pattani and Namrin areas.Due to the fact that 15 additional parameters were needed to take the species factor into account, the adjusted percentages have wider confidence intervals than the crude percentages.This effect is particularly notable for the Tak Bai area because the imposex was only found to occur among one of the three species groups observed there.

Complication-based neonatal morbidity risk
Based on complications recorded for 19,268 singleton deliveries to mothers with no previous Caesarean-section birth at Pattani Hospital in Southern Thailand over a nine-year period from 1997 to 2005, Rachatapantanakorn and Tongkumchum (2009) classified babies as high or low risk, and used logistic regression to assess the effects of six demographic risk factors.
Figure 2 shows 95% confidence intervals of the crude and adjusted percentages for each determinant before and after adjusting for the other determinants.The main differences between the crude and adjusted risks occurred among three demographic factors: the number of pregnancies (gravid group), age-group and religion.
Mothers in gravid group 4 or more pregnancies had highest risk percentage before adjustment, but after adjusting for the other determinants the risk was highest for primigravid mothers.For the age-group effect, the crude percentage was lowest for mothers aged 25-29 years, whereas the adjusted percentage was lowest for mothers aged less than 20 years.It is also noteworthy that the quite large difference in risks between Muslim and non-Muslim mothers was reduced after adjusting for the other factors.

Discussion
In this paper we have described a simple method for adjusting proportions for categorical covariates based on a fitted logistic regression model that provides asymptotically valid confidence intervals for comparing proportions over different levels of a categorical risk factor.While this method is not entirely new (see, for example, related earlier work by Berthold et al., 2007;Graubard & Korn, 1999;Lane & Nelder, 1982), it is not widely used in scientific studies, particularly when comparing more than two proportions.A further advantage of the method is that by using appropriately weighted sum contrasts each proportion can be compared with the overall mean rather than with a specified reference group.

Acknowledgement
We are grateful to Professor Don McNeil for his helpful guidance.

Figure 1 .
Figure 1.The 95% confidence intervals for percentages of female gastropods with imposex disease at various locations around the Gulf of Thailand; the upper and lower panels show crude and species-adjusted percentages, and the sample sizes are given on the right.