[R] question regarding GAM from a novice (in GAM as well as in R)

Tor A Strand Tor.Strand at cih.uib.no
Sat Jul 12 18:50:21 CEST 2003

Need to use generalized additive models and have therefore obtained R

I am able to do the analysis but I have problems understanding the syntax
and the options

Can someone explain what some of the terms do in this model do:?

c<-gam(depvar~var1+var2+s(var3)+s(var4, by=var5)+s(var6, var7)+s(var8,3),
data=xdataset ) 

I do not use the terms including var4- var8 in my model, just want to know
what they do. 

+s(var4, by=var5)
+s(var6, var7)

Furthermore, the results become rather different when I change the model to:

c<-gam(depvar~var1+var2-1+s(var3)+s(var4, by=var5)+s(var6, var7)+s(var8,3),
data=xdataset ) 
# note just adding a -1


Please forgive my ignorance.

Dr. Tor A Strand   
Centre for International Health
Haukeland Hospital
University of Bergen
5021 Bergen    
Phone: (country prefix 47)
Residence:56 51 10 88, office: 55 97 49 80,
fax: 55 97 49 79, cellular:  90 97 10 86

More information about the R-help mailing list