处理与拦截堆叠的预测变量

时间:2015-04-13 15:02:51

标签: r logistic-regression categorical-data

我的因素"时间"是一个分类预测器,其值为1和2.当我应用as.factor时,我认为值1的类别与截距堆叠在一起。我有没有办法让堆叠发生?

Call:
glm(formula = Appointment.Status ~ as.factor(Hours), family = binomial, 
data = data_appt)

Deviance Residuals: 
Min       1Q   Median       3Q      Max  
-0.5593  -0.5593  -0.5593  -0.4781   2.1098  

Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
(Intercept)       -2.11132    0.04523 -46.681  < 2e-16 ***
as.factor(Hours)2  0.33508    0.05435   6.166 7.02e-10 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

Null deviance: 10871  on 13970  degrees of freedom
Residual deviance: 10832  on 13969  degrees of freedom
AIC: 10836

Number of Fisher Scoring iterations: 4

0 个答案:

没有答案