s-news
[Top] [All Lists]

[S] gam prediction

To: s-news@wubios.wustl.edu
Subject: [S] gam prediction
From: Xu Fan <fan@stat.cmu.edu>
Date: Thu, 29 Jul 1999 12:31:12 -0400 (EDT)
Sender: owner-s-news@wubios.wustl.edu
I encountered some surprises when using  fitted gam object to
predict based on new regressor values. It might be due to some simple
grammar mistakes.

mod <- gam(ozone^(1/3) ~ lo(radiation) + lo(wind, temperature), data =
air)

newdata <- data.frame(ozone=4,radiation=200,temperature=70,wind=8)
predict.gam(mod,data=newdata)
  # why do I get 111 outputs? I expect a single output corresponding to
  # the new regressors feeded.

predict.gam(mod, data=air[1,])
  # still 111 outputs.

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>