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 my equation.

I tried to do so by estimating:

eq1 <- gam(y~s(time,bs="cr")+s(x1,bs="cr")+s(x2,bs="cr")+s(x3,bs="cr")+
    D1+D2+D3+D4+D5+D6+lag(y, k = 1),data=bellver,family=gaussian)

where (D1,...,D7 are day-of-the-week dummies; x1, x2 and x3 are 
weather related variables; time is a trend; and lag(y, k = 1) was supposed
to be the lag of the dependent variable)

but this did not work.

So, HOW CAN I INTRODUCE THE LAG IN MY GAM ESTIMATIONS?

Thank you very much. Your help will be very valuable.

Receive my best regards,

Oscar




______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to