[R] Finding all the coefficients for a logit model

R. Michael Weylandt michael.weylandt at gmail.com
Fri Feb 10 06:08:23 CET 2012


Add -1 to your glm to remove the intercept term -- that will force
Friday to have its own coefficient.

E.g.,

dg <- data.frame(value = rnorm(28), day = letters[1:7])
lm(value ~ day, data = dg)
lm(value ~ day - 1, data = dg)

Michael

On Thu, Feb 9, 2012 at 6:58 PM, Abraham Mathew <abmathewks at gmail.com> wrote:
> Let's say I have a variable, day, which is saved as a factor with 7 levels,
> and I use it in a
> logistic regression model. I ran the model using the car package in R and
> printed out the
> results.
>
> mod1 = glm(factor(status1) ~ factor(day), data=mydat,
> family=binomial(link="logit"))
> print(summary(mod1))
>
> The result I get is:
>
> Coefficients:
>                     Estimate Std. Error z value Pr(>|z|)
> (Intercept)           -0.4350     0.0379  -11.48   <2e-16 ***
> factor(day)Monday     -0.6072     0.0479  -12.69   <2e-16 ***
> factor(day)Saturday    0.5964     0.0559   10.67   <2e-16 ***
> factor(day)Sunday      1.1140     0.0627   17.78   <2e-16 ***
> factor(day)Thursday   -0.4492     0.0516   -8.71   <2e-16 ***
> factor(day)Tuesday    -0.9331     0.0496  -18.82   <2e-16 ***
> factor(day)Wednesday  -0.8575     0.0486  -17.63   <2e-16 ***
>
>
> It seems that Friday is being used as the baseline, but I want to know
>
> how I can acquire the coefficient for the baseline (friday)?
>
>
> I ran mod1$coefficients, but that didn't do the trick.
>
>
> Can anyone help.
>
>
> Thank you,
>
> Abraham M.
>
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list