Skip to content

Gamm and post comparison

2 messages · RHam, Gavin Simpson

#
My data set consist of number of calls (lcin) across Day. I am looking for
activity differences between three features (4 sites per feature). I am also
looking for peaks of activity across time (Day). I am using a gamm since I
believe these are nonlinear trends with nested data.

gammdata<-gamm(lcin~Temp+s(Day)+fType+wind+fFeature+Forest+Water+Built,
list=fSite,data=data, family=gaussian)

summary(gammdata$gam)
summary(gammdata$lme)
anova(gammdata$gam)
 
I can see which variables are significant but I was wondering if there was a
way to do a post hoc to see differences between features? Or is there a way
to compare different models (feature) for significance (not best fit)
against each other?

Thanks,
Rham  

--
View this message in context: http://r.789695.n4.nabble.com/Gamm-and-post-comparison-tp4411366p4411366.html
Sent from the R help mailing list archive at Nabble.com.
6 days later
#
On Wed, 2012-02-22 at 10:55 -0800, RHam wrote:
You don't need gamm() for this as you don't appear to be using any
random effects. gam() will be fine for the model you show below.

I don't know enough about the workings of mgcv to know whether you can
leverage functions in the multcomp package; gam objects inherit from glm
and lm classes and multcomp can work with these, though do not the point
in ?gamObject that gam objects lack the details of the fitting expected
in glm or lm objects.

IIRC, that model could be fitted as a linear mixed model if the smooth
term is set up correctly. multcomp can work with nlme and lme4 so you
could continue to use gamm() as below but use the multcomp package on
the $lme component. The gamm4 package provides a version of gamm() that
uses lme4 instead of nlme for the underlying fitting. Again you might
look into using the lmer representation of the model with multcomp.

None of the above is tested or even based on personal experience of
doing this.

G