[R] Multiple interaction terms in GAMM-model

Jeroen jeroen.van.leuken at rivm.nl
Mon Jul 29 11:48:58 CEST 2013


Thanks for your extended reply. Application of the splines seems to be very
plausible.
 
I have now added random effects to the GAMM-model:

random= list( objectID= ~1|doy )

(is that defined correct?)

But I am wondering how to include both time and space in one te()-function?
Or would it be better to not use the by= factor(region), but a special
spatial autocorrelation with the x and y-coordinates per objectID? Thus
something like:

 correlation= corAR1( form= ~ objectX + objectY )

Thus resulting in the GAMM-model:

model.formula           <- formula( tau ~ te( x1, doy, bs= c('cr','cc' ) ) +
... + te( x4, doy, bs= c('cr', 'cc' ) ) )
model                           <- gamm( formula= model.formula, 
                                             random= list( farmID=
~1|dayOfTheYear ),
                                             correlation= corAR1( form= ~
farmX+farmY ), 
                                             control= ctrl,
                                             na.action= na.omit )

Concerning the memory, yes this will be an issue. I have a 16 GB server
available with 6 processors. Maybe it would be wise to run 4 seperate
GAMM-models, i.e. with x1, x2, x3, and x4 seperated. 

Thanks in advance.

Jeroen







--
View this message in context: http://r.789695.n4.nabble.com/Multiple-interaction-terms-in-GAMM-model-tp4672297p4672577.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list