Skip to content

prediction from glm...

2 messages · hugues santin janin, Brian Ripley

#
Hello r-help, 

I'm trying to fit birds counts over years using glm. In fact I'm trying to reproduce an analysis already perform with genstat (attach document). I have done (with Estate
and year as factors):

Model1 <- glm(Females~Estate+Year+offset = log(area)), family =
quasipoisson(link = log), na.action = "na.exclude") 

After I have calculated the prediction using:

Pred1 <- predict(Model1, type = "response", na.action = "na.exclude")

Pred1 given to me the prediction using Model1 e.g. Females~Estate+Year. But I search to reproduce the original data whitout the sEstate effect. That permit me to interprete only the variation in number of bird due to theYear. The argument new.data seems  useful to specify which data we want to predict but not to specify how to predict these data.
 
predict.glm is the good functoin to do that? How can I specify to predict.glm() to remove the sEstate effect of the Females prediction?
 
I have not found answer in the archives of R-help.
I thank you for your time and your help in regards to this problem,

Hugues SANTIN-JANIN

hugues_sj at yahoo.fr

"Game Conservancy Trust"






		
---------------------------------
#
On Sun, 7 Aug 2005, hugues santin janin wrote:

            
That is not valid R. 
Did you actually use  Females~Estate+Year+offset(log(area)) ?
That is not what I read Model1 to be.
Did you mean the 'Estate' term?  Otherwise, what is `sEstate'?
Did you mean `newdata'?
You fit a model without the term if you want to predict from a different 
model.
I am sorry, but you will need to be *accurate* in what you write, as you 
have made too many errors for me (at least) to guess what you mean.

This sort of thing is covered in all good texts on R, of which there are 
several in the FAQ.