[R] summary(glm) for categorical variables

John Vokey vokey at uleth.ca
Tue Sep 12 22:00:58 CEST 2006


You want:
anova(my.glm)

On 12-Sep-06, at 4:00 AM, r-help-request at stat.math.ethz.ch wrote:

> Suppose we have a data.frame where variables are categorical and  
> the response is
> categorical eg:
>
> my.df=NULL
>
> for(i in LETTERS[1:3]){my.df[[i]]=sample(letters, size=10)}
>
> my.df=data.frame(my.df)
>
> my.df$class=factor(rep(c("pos", "neg"), times=5))
>
> my.glm=glm(class ~ ., data=my.df, family=binomial)
>
> summary(my.glm)
>
> ....
>               Estimate Std. Error   z value Pr(>|z|)
> (Intercept)  2.457e+01  1.310e+05  1.88e-04        1
> Ad          -8.559e-11  1.853e+05 -4.62e-16        1
> Aj          -9.897e-10  1.853e+05 -5.34e-15        1
> An          -4.913e+01  1.853e+05 -2.65e-04        1
> ...
>
> My question is is it possible to get the terms to appear as A,B, C  
> instead of
> every combination of Aa, Ab, Ac etc separately?
>
> Many Thanks in advance



More information about the R-help mailing list