[R] Question about predict.glm
Prof Brian D Ripley
ripley at stats.ox.ac.uk
Sat Jul 8 20:08:58 CEST 2000
On Sat, 8 Jul 2000 brian_adams at jbadams.com wrote:
> I am trying to use predict.glm to validate a logistic model. Using
> predictions <- predict.glm(logit.model, type="response",
> I get the predictions from the original dataframe, not the validation
> data frame. Am I missing an input to the method or is this what is
> supposed to happen?
The argument is `newdata'. ?predict.glm seems clear enough to me
(but then I wrote it).
predict.glm(object, newdata = NULL, type = c("link", "response",
se.fit = FALSE, dispersion = NULL, terms = NULL, ...)
object: a fitted object of class inheriting from `"glm"'.
newdata: optionally, a new data frame from which to make the
predictions. If omitted, the fitted linear predictors are
so I think it is working as documented ....
Brian D. Ripley, ripley at 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 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
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