0
$\begingroup$

I'm new to logistic regression analysis, and was unable to find an answer elsewhere in Cross Validated or Stack Overflow.

Consider a standard logistic regression analysis of a binary outcome (admission to college) based on continuous covariates gre score and high school gpa, and ordinal categorical rank prestige of the undergraduate institution (data from the nice UCLA stats dept. logistic regression in R tutorial: http://www.ats.ucla.edu/stat/r/dae/logit.htm)

> admissions.data <- read.csv("http://www.ats.ucla.edu/stat/data/binary.csv")
> admissions.data$rank <- as.factor(admissions.data$rank)
> summary(admissions.data)
     admit             gre             gpa        rank
 Min.   :0.0000   Min.   :220.0   Min.   :2.260   1: 61
 1st Qu.:0.0000   1st Qu.:520.0   1st Qu.:3.130   2:151
 Median :0.0000   Median :580.0   Median :3.395   3:121
 Mean   :0.3175   Mean   :587.7   Mean   :3.390   4: 67
 3rd Qu.:1.0000   3rd Qu.:660.0   3rd Qu.:3.670
 Max.   :1.0000   Max.   :800.0   Max.   :4.000

> fit1 <- glm(admit ~ gre + gpa + rank, data = admissions.data, family="binomial")
> summary(fit1)

Call:
glm(formula = admit ~ gre + gpa + rank, family = "binomial",
    data = admissions.data)

Deviance Residuals:
    Min       1Q   Median       3Q      Max
-1.6268  -0.8662  -0.6388   1.1490   2.0790

Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept) -3.989979   1.139951  -3.500 0.000465 ***
gre          0.002264   0.001094   2.070 0.038465 *
gpa          0.804038   0.331819   2.423 0.015388 *
rank2       -0.675443   0.316490  -2.134 0.032829 *
rank3       -1.340204   0.345306  -3.881 0.000104 ***
rank4       -1.551464   0.417832  -3.713 0.000205 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 499.98  on 399  degrees of freedom
Residual deviance: 458.52  on 394  degrees of freedom
AIC: 470.52

Number of Fisher Scoring iterations: 4

# Odds Ratios
> exp(coef(fit1))
(Intercept)         gre         gpa       rank2       rank3       rank4
  0.0185001   1.0022670   2.2345448   0.5089310   0.2617923   0.2119375

# 95% confidence intervals
> exp(confint(fit1))
Waiting for profiling to be done...
                  2.5 %    97.5 %
(Intercept) 0.001889165 0.1665354
gre         1.000137602 1.0044457
gpa         1.173858216 4.3238349
rank2       0.272289674 0.9448343
rank3       0.131641717 0.5115181
rank4       0.090715546 0.4706961

My questions are:

1) In R, is there a straight-forward way to determine ORs with 95% CIs for specific values of the covariates? E.g., based on this model, what are the odds of college acceptance for students applying to a rank 2 schools with a gpa of 3 and a gre score of 750, compared with a student applying to a rank 3 school with the same gpa and gre score? I could calculate ORs by hand given the model coefficient estimates and these specific covariate values, but am unsure how to correctly propagate SEs to calculate 95% CIs.

2) Would this particular example be considered a case-control study design, and therefore odds ratios could be estimated, but not predictions? (See: Case-control study and Logistic regression)

$\endgroup$
1
  • $\begingroup$ If anyone is going to be able to understand this without external links they will need to know the details of the study to which you refer. $\endgroup$
    – mdewey
    Commented Jun 30, 2016 at 17:29

1 Answer 1

1
$\begingroup$

1) I do not completely understand your question. In logistic regression, the odds ratios do not change for each individual based on his or her particular covariates. For example, in the model you provided, you estimate that a one unit increase in gpa corresponds to a 2.23-fold increase in the odds of admission. Period.

Maybe what you're looking for is predicted probabilities for a particular subject? These you can estimate using R's 'predict' function, which can be used to make predictions on new data, with a confidence interval. This example may be helpful: http://www.ats.ucla.edu/stat/r/dae/logit.htm.

2) No, I do not think this is a (matched) case control study, because in the example dataset participants were not selected because they were admitted and then matched with another person who was not admitted. You are correct that, in a case control study, we cannot predict the probability of an individual experiencing an event; case control studies tell us only about the relative odds for any particular risk factor, because participants are selected based on case status. That's why case control studies with matched pairs are often analyzed using a method like conditional logistic regression which throws out the intercept entirely, but explicitly accounts for the matched-pairs design.

$\endgroup$
2
  • $\begingroup$ Thanks for your comments - the questions are motivated by a peer reviewer who has asked for odds ratios +/- CIs for specific values of model covariates, NOT predicted outcome probabilities for individual subjects. I believe what is being asked for is an estimation of the odds ratio as function of other variables in the model. Hosmer & Lemeshow's "Applied Logistic Regression" text provides an example of this in Figure 3.5, but am unable to find an example of implementing this in R. Thanks. $\endgroup$
    – Lorenz D
    Commented Jun 30, 2016 at 18:17
  • $\begingroup$ @LorenzD The reviewer is right. You should never report the log of the odds ratios (which is what R gives you when you call coef or confint on a glm object of family binomial). Transforming these values is dead easy though, just take the exponent of their value. $\endgroup$
    – AdamO
    Commented Jun 30, 2016 at 18:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.