[R] glm.predict?
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Tue Jan 22 10:11:56 CET 2002
"Patrick Connolly" <P.Connolly at hortresearch.co.nz> writes:
> foo.glm <- glm(Insects ~ Dad * Mum + Location, offset = log(MM), family
> = "poisson", data = model.df)
>
..
> things <- list()
> things$fitA <- predict(foo.glm, type = "response")
> things$fitB <- predict(foo.glm, type = "response", se.fit = TRUE)$fit
> 1: longer object length
> is not a multiple of shorter object length in: predictor + offset
> 2: longer object length
> is not a multiple of shorter object length in: se.fit * abs(family(object)$mu.eta(fit))
I got:
> predict(foo.glm,se=T)
Error in log(MM) : Object "MM" not found
which looks like it is part of the problem
This works:
> predict(foo.glm,se.fit=T,newdata=model.df)
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list