2
$\begingroup$

In R I have a categorical variable that I performed logistic regression on and got the following result:

glm(formula = mortality ~ SMOKE, family = binomial, data = c.data)

Deviance Residuals: 
    Min       1Q   Median       3Q      Max  
-0.2155  -0.2155  -0.2155  -0.1860   2.8515  

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)  -4.0483     0.3189 -12.694   <2e-16 ***
SMOKEN        0.2968     0.3559   0.834    0.404    
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 492.45  on 2369  degrees of freedom
Residual deviance: 491.72  on 2368  degrees of freedom
AIC: 495.72

Number of Fisher Scoring iterations: 6

Is the value for the intercept the same as SMOKEY (has a history of smoking)?

$\endgroup$
7
$\begingroup$

I think so, based on what I can gather from your posted output.

In general, the intercept gives the mean level of the response variable when all other variables are 0. When you have categorical variables, by default most software (including R) will use reference cell coding. This means that one level of the categorical variable will be considered the reference level, and will be coded as 0. The other level will be coded as 1. Thus, in your case, the intercept is the mean level of the response variable for those in the reference level of SMOKE, which I suspect are smokers. My reasoning here is that your variable is SMOKE, and the non-reference-level is labeled SMOKEN, which I am interpreting as SMOKE-"no". If you'd like, you can set the reference level to be exactly what you want, so that you know for sure. You can do so in R (see here) by using the command:

c.data$SMOKE <- factor(c.data$SMOKE, levels=c("yes", "no"))  

Here are some basic things you want to be sure you understand about logistic regression:

The Estimate in the case of logistic regression is a log odds; thus to find the probability you would exponentiate the estimate and then divide that value by 1 + that value. What is being assessed by the test of the intercept is whether that probability is 50%. (In your case, your reference level is significantly less than 50%.) The estimate for SMOKEN is the difference between the log odds for the reference level and the other level of your categorical variable. (Note that the two levels do not differ significantly.)

$\endgroup$
  • 1
    $\begingroup$ Good answer but one note. Not all software uses reference cell coding by default (although I think this is the best option). SAS in PROC LOGISTIC uses effect coding and I vaguely recall that S+ at one point (or maybe it was an earlier R?) used Helmert contrasts. $\endgroup$ – Peter Flom - Reinstate Monica Jul 6 '13 at 12:34
  • $\begingroup$ That's a reasonable point, @PeterFlom, I added a caveat. $\endgroup$ – gung - Reinstate Monica Jul 6 '13 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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