Re: [R] Predictions with GAM

2009-01-21 Thread Robbert Langenberg
In addition to this, is it in anyway possible to get the variance in the prediction graph as a shade similar to the GAM plots? 2009/1/21 Robbert Langenberg > Thanks a lot for all the mails! > > With all the different examples I now have got it working. The problem > finally after I had worked ou

Re: [R] Predictions with GAM

2009-01-21 Thread Robbert Langenberg
Thanks a lot for all the mails! With all the different examples I now have got it working. The problem finally after I had worked out the newd2 as supplied by Gavin was that I found the plot so strange looking. I have altered my newd2 a bit, and after your e-mails Simon I figured out how to finall

Re: [R] Predictions with GAM

2009-01-21 Thread Simon Wood
Here's a simulated example (although really for this model structure, one might as well fit seperate models for each factor level). ## Simulate some data with factor dependent smooths n <- 400 x <- runif(n, 0, 1) f1 <- 2 * sin(pi * x) f2 <- exp(2 * x) - 3.75887 f3 <- 0.2 * x^11 * (10 * (1 - x))

Re: [R] Predictions with GAM

2009-01-18 Thread Simon Wood
Robbert, On Friday 16 January 2009 14:30, Robbert Langenberg wrote: > Thanks for the swift reply, > > I might have been a bit sloppy with describing my datasets and problem. I > showed the first model as an example of the type of GAM that I had been > able to use the predict function on. What I am

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
Ken Knoblauch inserm.fr> writes: > Robbert Langenberg gmail.com> writes: > > I am trying to get a prediction of my GAM on a response type. So that I > > eventually get plots with the correct values on my ylab. > > The problem I am encountering now is that I cannot seem to get it done for > > the

Re: [R] Predictions with GAM

2009-01-16 Thread Ken Knoblauch
Hi, Robbert Langenberg gmail.com> writes: > I am trying to get a prediction of my GAM on a response type. So that I > eventually get plots with the correct values on my ylab. > The problem I am encountering now is that I cannot seem to get it done for > the following type of model: > > *model3<-

Re: [R] Predictions with GAM

2009-01-16 Thread Robbert Langenberg
Thanks for the swift reply, I might have been a bit sloppy with describing my datasets and problem. I showed the first model as an example of the type of GAM that I had been able to use the predict function on. What I am looking for is how to predict my m3: model3<-gam(y_no~s(day,by=mapID),family=

Re: [R] Predictions with GAM

2009-01-16 Thread Gavin Simpson
On Fri, 2009-01-16 at 12:36 +0100, Robbert Langenberg wrote: > Dear, > > I am trying to get a prediction of my GAM on a response type. So that I > eventually get plots with the correct values on my ylab. > I have been able to get some of my GAM's working with the example shown > below: > * > model

[R] Predictions with GAM

2009-01-16 Thread Robbert Langenberg
Dear, I am trying to get a prediction of my GAM on a response type. So that I eventually get plots with the correct values on my ylab. I have been able to get some of my GAM's working with the example shown below: * model1<-gam(nsdall ~ s(jdaylitr2), data=datansd) newd1 <- data.frame(jdaylitr2=(24