[R] Generalized linear model
Marcos Sanches
marcos_sanches at gallup.com
Mon Nov 17 15:27:47 CET 2003
Hi all!
I am fitting a Poisson model, using the following command:
> fit2<-glm(canc~id1+year1+time+lnpa,family=poisson)
where 'id1', 'year1' and 'time' are factors. I defined them with:
> id1<-C(factor(id1), treatment)
and 'lnpa' is a continuous variable.
The 'summary' function gives me all the effects estimates, that is, for id1,
I end up with estimates for id12, id13 and id14, the id11 is the reference
level. That is fine, but when I try to fit the model without the point 18,
using the command line:
> fit2<-glm(canc~id1+year1+time+lnpa,family=poisson, subset(dat, order!=18))
The 'summary' function stop to giving me the levels effect, and gives only
one effect for id1, one for year1, one for time and one for lnpa. I want to
have the parameters estimates for each level of each factor, as it was in
the first fit. Also, I noticed the degree of freedom of deviance and the
deviance itself has increased, so I cont't compare both models in terms of
their deviance.
What should I do to have each factor level effect as I had in the first
case?
Thanks
Marcos
More information about the R-help
mailing list