Re: [R] GAMs in R : How to put the new data into the model?

2011-09-29 Thread Simon Wood
See ?predict.gam You create a data frame (e.g. `dat2011') containing the 2011 values for RH, solar, windspeed and transport, then predict(cod,dat2011,type=response) there are various options for type -- see ?predict.gam On 09/28/2011 10:10 AM, pigpigmeow wrote: For example: GAMs and

Re: [R] GAMs in R : How to put the new data into the model?

2011-09-29 Thread Gavin Simpson
On Wed, 2011-09-28 at 02:10 -0700, pigpigmeow wrote: For example: GAMs and after stepwise regression: You probably don't want to be doing stepwise model/feature selection in any regression model. Marra Wood (2011, Computational Statistics and Data Analysis 55; 2372-2387) show results that

Re: [R] GAMs in R : How to put the new data into the model?

2011-09-28 Thread pigpigmeow
For example: GAMs and after stepwise regression: cod-gam(newCO~RH+s(solar,bs=cr)+windspeed+s(transport,bs=cr),family=gaussian (link=log),groupD,methods=REML) I used 10 year meterorology data (2000-2010) to form equation of concentration of carbon monoxide. NOW, I have 2011 meteorology data, I

[R] GAMs in R : How to put the new data into the model?

2011-09-27 Thread pigpigmeow
I have 5 GAMs ( model1, model2, model3, model4 and model5) Before I use some data X(predictor -January to June data) to form a equation and calculate the expected value of Y (predictand -January to June). After variable selection, GAMs (Model 1)were bulit up! R-square :0.40 NOW, I want to use

Re: [R] GAMs in R : How to put the new data into the model?

2011-09-27 Thread Daniel Malter
Your questions is pretty opaque. Please adhere to the posting guide. Provide a self-contained (!) example (i.e., code) that reproduces your problem. Generally, you would predict like this: x-rnorm(100) e-rnorm(100) y-x+x^2+e reg-gam(y~s(x)) plot(reg) predict(reg,newdata=data.frame(x=2)) where