Re: [R] prediction from glm...

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Mon 08 Aug 2005 - 02:47:46 EST

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

> 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")

That is not valid R.
Did you actually use Females~Estate+Year+offset(log(area)) ?

> 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.

That is not what I read Model1 to be.

> But I search to reproduce the original data whitout the sEstate effect.

Did you mean the 'Estate' term? Otherwise, what is `sEstate'?

> 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.

Did you mean `newdata'?

> 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?

You fit a model without the term if you want to predict from a different model.

> 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,

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.

-- 
Brian D. Ripley,                  ripley@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Aug 08 02:54:23 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:07:59 EST