[R] predict.glm

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Thu Apr 5 21:36:22 CEST 2001


Robert John Foxall <rjf at waca.sys.uea.ac.uk> writes:

> Hello,
> 	Probably a stupidly easy question, but I have done the following
> in order to make predictions from a fitted glm with new data:
> 
> my.glm <- glm(lt96~so296[,1:17],family=binomial(link=logit))
> p96 <- predict.glm(my.glm,newdata=so293[,1:17],type="response")
> 
> but I always get the fitted linear predictors from the original model, ie
> there doesn't seem to be acknowledgement of the new data. Linux on my
> machine, running R version 1.1.1 (will upgrade soon!).
> 
> Cheers,
> 	Rob Foxall.

check the variable names! I kind of suspect that so293 has no
variables called something with so296...

I think you mean something like

glm(lt96~.,data=so296[,1:17],....
predict.glm(my.glm....
-- 
   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