[R] help with predict in stats4

Gad Abraham gabraham at csse.unimelb.edu.au
Sun Dec 14 07:57:26 CET 2008


David Kaplan wrote:
> Hi,
> 
> We're using stats4 for a logistic regression.  The code is
> 
> chdreg.logit2 <- glm(chd ~ age + sex, family = binomial)
> summary(chdreg.logit2)
> oddsratios <- coef(chdreg.logit2)
> exp(oddsratios)
> 
> # Calculate model predicted values
> pred <- predict(chdreg.logit2,type="response")
> 
> The glm part runs fine, and up to now so has the predict function.  
> However, now we're getting the following error
> 
> Error in function (classes, fdef, mtable)  :
>  unable to find an inherited method for function "predict", for 
> signature "glm"
> 
> Any thoughts about why this seems to now be appearing.
> Thanks in advance.
> 
> 

Just a guess, but perhaps you've loaded some other package which 
redefines predict() in an incompatible way?

-- 
Gad Abraham
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabraham at csse.unimelb.edu.au
web: http://www.csse.unimelb.edu.au/~gabraham



More information about the R-help mailing list