Re: [R] Introducing lags in my GAM

2010-10-05 Thread Simon Wood
I think that the problem is probably that y and lag(y,k=1) just get coerced back to numeric (i.e. their time-series attributes ar lost). So your model formula is equivalent to y~ + y, which is probably not what you wanted. If y is in time order, I would do something like bellver$y.1 <- c

[R] Introducing lags in my GAM

2010-10-05 Thread Oscar Saenz de Miera
To whom it may concern, This is Oscar Saenz. I am working on my thesis and wanted to ask for your help. I am using "R" to estimate a Generalized Additive Model where the concentration of a specific pollutant is explained by a series of variables. I need to introduce a lag of the regressand in m