Sunday, 8 September 2013

Logit with R: predictors variable with value 1 don't appear

Logit with R: predictors variable with value 1 don't appear

Update: I'm not sure if I should have posted to
http://stats.stackexchange.com or to this site. Moderators: feel free to
migrate if needed...
I create the following logit regression according to the data:
data(Titanic)
My outcome variables is:
survived=='yes'
My predictor variables are:
sex(factor): Male vs Female
age(numeric)
passengerClass(factor): 1st vs 2nd vs 3nd Class
R code is:
> titanic <- glm(formula=survived=='yes' ~ age + sex +
passengerClass,family=binomial(),data=Titanic,na.action=na.omit)
ANOVA GIVES:
> Anova(titanic,type='II',test.statistic='Wald')
Analysis of Deviance Table (Type II tests)
Response: survived == "yes"
Df Chisq Pr(>Chisq)
age 1 29.512 5.557e-08 ***
sex 1 226.320 < 2.2e-16 ***
passengerClass 2 103.299 < 2.2e-16 ***
Residuals 1041
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
SUMMARY GIVES:
> summary(titanic)
Call:
glm(formula = survived == "yes" ~ age + sex + passengerClass,
family = binomial(), data = Titanic, na.action = na.omit)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.6399 -0.6979 -0.4336 0.6688 2.3964
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 3.522074 0.326702 10.781 < 2e-16 ***
age -0.034393 0.006331 -5.433 5.56e-08 ***
sexmale -2.497845 0.166037 -15.044 < 2e-16 ***
passengerClass2nd -1.280570 0.225538 -5.678 1.36e-08 ***
passengerClass3rd -2.289661 0.225802 -10.140 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 1414.62 on 1045 degrees of freedom
Residual deviance: 982.45 on 1041 degrees of freedom
(263 observations deleted due to missingness)
AIC: 992.45
Number of Fisher Scoring iterations: 4
My issue is that I don't have infos about predictors with value 1 such as
the females and the 1st Class passenger. How to get those informations?
Typically my aim is to get the p-value of 1st class, 2nd class and 3nd
class in order to know if the p-value of the 1st class is the smallest...

No comments:

Post a Comment