fit <- glm(formula=y~x1+x2+x3, family = binomial)
x3
is categorical variable (yes/no). The corner point (which is a part of the Intercept) becomes automatically 'no' for this variable. I want to change the corner point to 'yes'. How do I do that?
EDIT for future reader with same problem: Change the the level of x3
Some code
> attach(dat)
> levels(x9)
[1] "ja" "nej"
> x9 <-factor(x9, levels = c("nej","ja"))
> levels(x9)
[1] "nej" "ja" ###Changing the level was succesfull
> summary(glm(y~.,family = binomial, data=dat))
Call:
glm(formula = y ~ ., family = binomial, data = dat)
Deviance Residuals:
Min 1Q Median 3Q Max
-3.2508 0.2410 0.4698 0.6234 1.5827
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) 4.79255 1.42304 3.368 0.000758 ***
x1 -3.19187 2.31703 -1.378 0.168336
x2 1.55657 2.70719 0.575 0.565308
x3 -3.27159 1.08943 -3.003 0.002673 **
x4nej 0.51869 0.41696 1.244 0.213505
x5nej -1.51137 0.75315 -2.007 0.044776 *
x6nej 0.18231 0.30013 0.607 0.543565
x7 0.08706 0.08027 1.085 0.278120
x8b -0.71031 0.30084 -2.361 0.018220 *
x9nej 0.92448 0.38464 2.403 0.016240 * ###OPS: I want: x9ja here
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 396.49 on 425 degrees of freedom
Residual deviance: 342.66 on 416 degrees of freedom
AIC: 362.66
Number of Fisher Scoring iterations: 6