Displaying 1 result from an estimated 1 matches for "so2median".
Did you mean:
comedian
2011 Jun 21
5
please help for mgcv package
i read a book from WOOD, there's an example which is talking about the
pollutant.
library(gamair)
library(mgcv)
y<-gam(death~s(time,bs="cr",k=200)+s(pm10median,bs="cr")+s(so2median,bs="cr")+s(o3median,bs="cr")+s(tmpd,bs="cr"),data=chicago,family=Possion)
lag.sum<-function(a,10,11)
{n<-length(a)
b<-rep(0,n-11)
for(i in 0:(11-10))
b<-b+a[(i+1):(n-11+i)]
b}
death<-chicago$death[4:5114]
time<-chicago$time[4:5114]
o3<-lag.sum(c...