[R] interactions in GAMs

2012-11-27 Thread chirleu
Hi all, I wonder if it's possible to include a double interaction in a GAM formula. Example: If I do this: mod=gam(energy~s(size, *by=color, by=sex*, k=5) + temperature, ...) I get the interaction betwen size*color and size*sex. But I need size*color*sex, being size a smoother. I've created a n

[R] Post hoc tests in gam (mgcv)

2012-11-05 Thread chirleu
Hi. I'm analysing some fish biological traits with a gam in mgcv. After several tries, I got this model log(tle) = sexcolor + s(doy, bs = "cc", by = sexcolor) +log(tl) sexcolor is a factor with 4 levels doy is "day of year", which is modeled as a smoother tl is "total length of the fish" The sum

[R] Add lines to xy plot with temporal x axis

2011-08-26 Thread chirleu
Hi. I'm trying to add some vertical lines to an xyplot in which x axis is a temporal variable (class=dates) and y axis a factor variable. This is my code: xyplot(factor(Abacus$Emisor)~Abacus$Dia,xlab="Date", ylab="Fish",pch=124, scales=list(x=list(format="%b %Y",tick.number=30)) , panel=function(