# How to interpret table of logistic regression coefficients using glm function in R [duplicate]

Possible Duplicate:
Logistic Regression in R (Odds Ratio)

I need to do a logistic regression in R. My response variable is surv=0; surv=1 and I have about 18 predictor variables.

After reading my model, I got the table of Coefficients below and I need to go through some steps, which I am not familiar with, until I get to the odds ratios.

This is my first time to do a logistic regression in R and your help would be appreciated.

Call:
glm(formula = surv ~ as.factor(tdate) + as.factor(line) + as.factor(wt) +
as.factor(crump) + as.factor(pind) + as.factor(pcscore) +
as.factor(ptem) + as.factor(pshiv) + as.factor(pincis) +
as.factor(presp) + as.factor(pmtone) + as.factor(pscolor) +
as.factor(ppscore) + as.factor(pmstain) + as.factor(pbse) +
as.factor(psex) + as.factor(pgf), family = binomial(link = "logit"),
data = ap)

Deviance Residuals:
Min       1Q   Median       3Q      Max
-1.9772  -0.5896  -0.4419  -0.3154   2.8264

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept)                -0.59796    0.27024  -2.213 0.026918 *
as.factor(tdate)2009-09-08  0.43918    0.19876   2.210 0.027130 *
as.factor(tdate)2009-09-11  0.27613    0.20289   1.361 0.173514
as.factor(tdate)2009-09-15  0.58733    0.19232   3.054 0.002259 **
as.factor(tdate)2009-09-18  0.52823    0.20605   2.564 0.010360 *
as.factor(tdate)2009-09-22  0.45661    0.19929   2.291 0.021954 *
as.factor(tdate)2009-09-25 -0.09189    0.21740  -0.423 0.672526
as.factor(tdate)2009-09-29 -0.15696    0.28369  -0.553 0.580076
as.factor(tdate)2010-01-26  1.39260    0.21049   6.616 3.69e-11 ***
as.factor(tdate)2010-01-29  1.67827    0.21099   7.954 1.80e-15 ***
as.factor(tdate)2010-02-02  1.35442    0.21292   6.361 2.00e-10 ***
as.factor(tdate)2010-02-05  1.36856    0.21439   6.383 1.73e-10 ***
as.factor(tdate)2010-02-09  1.18159    0.21951   5.383 7.33e-08 ***
as.factor(tdate)2010-02-12  1.40457    0.22001   6.384 1.73e-10 ***
as.factor(tdate)2010-02-16  1.01063    0.21783   4.639 3.49e-06 ***
as.factor(tdate)2010-02-19  1.54992    0.21535   7.197 6.14e-13 ***
as.factor(tdate)2010-02-23  0.85695    0.33968   2.523 0.011641 *
as.factor(line)2           -0.26311    0.07257  -3.625 0.000288 ***
as.factor(line)5            0.06766    0.11162   0.606 0.544387
as.factor(line)6           -0.30409    0.12130  -2.507 0.012176 *
as.factor(wt)2             -0.33904    0.10708  -3.166 0.001544 **
as.factor(wt)3             -0.28976    0.13217  -2.192 0.028359 *
as.factor(wt)4             -0.50470    0.16264  -3.103 0.001915 **
as.factor(wt)5             -0.74870    0.20067  -3.731 0.000191 ***
as.factor(crump)2           0.07537    0.10751   0.701 0.483280
as.factor(crump)3          -0.14050    0.13217  -1.063 0.287768
as.factor(crump)4          -0.20131    0.16689  -1.206 0.227724
as.factor(crump)5          -0.23963    0.20778  -1.153 0.248803
as.factor(pind)2           -0.29893    0.10752  -2.780 0.005434 **
as.factor(pind)3           -0.40828    0.12436  -3.283 0.001027 **
as.factor(pind)4           -0.73021    0.14947  -4.885 1.03e-06 ***
as.factor(pind)5           -0.68878    0.17650  -3.902 9.52e-05 ***
as.factor(pcscore)2        -0.52667    0.13606  -3.871 0.000108 ***
as.factor(ptem)2           -0.72600    0.08964  -8.099 5.52e-16 ***
as.factor(ptem)3           -0.79145    0.10503  -7.536 4.86e-14 ***
as.factor(ptem)4           -0.89956    0.10331  -8.707  < 2e-16 ***
as.factor(ptem)5           -0.90181    0.10721  -8.412  < 2e-16 ***
as.factor(pshiv)2           0.25236    0.07713   3.272 0.001068 **
as.factor(pincis)2          0.02327    0.07216   0.323 0.747041
as.factor(presp)2           0.43746    0.11598   3.772 0.000162 ***
as.factor(pmtone)2          0.34515    0.11178   3.088 0.002016 **
as.factor(pscolor)2         0.53469    0.26851   1.991 0.046443 *
as.factor(ppscore)2         0.25664    0.08751   2.933 0.003361 **
as.factor(pmstain)2        -0.48619    0.84408  -0.576 0.564611
as.factor(pbse)2           -0.28248    0.07335  -3.851 0.000117 ***
as.factor(psex)2           -0.18240    0.06385  -2.857 0.004280 **
as.factor(pgf)12            0.10329    0.14314   0.722 0.470554
as.factor(pgf)21           -0.06481    0.10772  -0.602 0.547388
as.factor(pgf)22            0.39584    0.12740   3.107 0.001890 **
as.factor(pgf)31            0.18820    0.10082   1.867 0.061936 .
as.factor(pgf)32            0.39662    0.13963   2.841 0.004504 **
as.factor(pgf)41            0.09178    0.10413   0.881 0.378106
as.factor(pgf)42            0.21056    0.14906   1.413 0.157787
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 7812.9  on 8714  degrees of freedom
Residual deviance: 6797.4  on 8662  degrees of freedom
(418 observations deleted due to missingness)
AIC: 6903.4

Number of Fisher Scoring iterations: 5

-
what is your question? How to get odd ratios? –  mpiktas May 24 '11 at 7:27
@mpiktas, that is what I need to get, yes! –  baz May 24 '11 at 7:35
are none of those predictors continuous variables? –  John May 24 '11 at 7:51
@John, logistic regression also accept nominal predictors, but they should be coded as dummy variables. –  Andrej May 24 '11 at 8:08

## marked as duplicate by whuber♦May 24 '11 at 16:26

exp(your.model\$coefficients)

where your.model is your R object with glm class. Similar question was ask previously; detailed answer is here.