Displaying 20 results from an estimated 300 matches similar to: "GAMs and GAMMS with correlated acoustic data"
2008 Nov 19
2
GAMM and anove.lme question
Greetings all
The help file for GAMM in mgcv indicates that the log likelihood for a
GAMM reported using
summary(my.gamm$lme) (as an example) is not correct.
However, in a past R-help post (included below), there is some indication
that the likelihood ratio test in anova.lme(mygamm$lme, mygamm1$lme) is
valid.
How can I tell if anova.lme results are meaningful (are AIC, BIC, and
logLik
2010 Jul 21
3
Interactions in GAMMs
Hi,
I've an issue adding an interaction to a GAMM:
My model was of form:
gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV
+ s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) +
s(Annprec) + s(OLDWDLD:DISTWOOD) + (1|fSITE), family = poisson, data =
BIOFOR2)
with interaction of s(OLDWDLD:DISTWOOD).
However I got this error message below but
2010 May 28
1
Comparing and Interpreting GAMMs
Dear R users
I have a question related to the interpretation of results based on GAMMs using Simon Woods package gamm4.
I have repeated measurements (hours24) of subjects (vpnr) and one factor with three levels (pred). The outcome (dv) is binary.
In the first model I'd like to test for differences among factor levels (main effects only):
gamm.11<-gamm4(dv ~ pred +s(hours24), random = ~
2009 Jul 08
1
Comparing GAMMs
Greetings!
I am looking for advice regarding the best way to compare GAMMs. I
know other model outputs return enough information for R's AIC, ANOVA,
etc. commands to function, but this is not the case with GAMM unless one
specifies the gam or lme portion. I know these parts of the gamm contain
items that will facilitate comparisons between gamms. Is it correct to
simply use these values
2009 May 18
1
Predicting complicated GAMMs on response scale
Hi,
I am using GAMMs to show a relationship of temperature differential over
time with a model that looks like this:-
gamm(Diff~s(DaysPT)+AirToC,method="REML")
where DaysPT is time in days since injury and Diff is repeat measures of
temperature differentials with regards to injury sites compared to
non-injured sites in individuals over the course of 0-24 days. I use the
following
2008 Aug 14
1
autocorrelation in gams
Hi,
I am looking at the effects of two explanatory variables on chlorophyll.
The data are an annual time-series (so are autocorrelated) and the
relationships are non-linear. I want to account for autocorrelation in
my model.
The model I am trying to use is this:
Library(mgcv)
gam1 <-gam(Chl~s(wintersecchi)+s(SST),family=gaussian,
na.action=na.omit, correlation=corAR1(form =~
2011 Jun 24
2
mgcv:gamm: predict to reflect random s() effects?
Dear useRs,
I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting purposes which account for the random smooth components of the fit.
An example. (sessionInfo() is at
2007 Oct 02
3
mcv package gamm function Error in chol(XVX + S)
Hi all R users !
I'm using gamm function from Simon Wood's mgcv package, to fit a spatial
regression Generalized Additive Mixed Model, as covariates I have the
geographical longitude and latitude locations of indexed data. I include a
random effect for each district (dist) so the code is
fit <- gamm(y~s(lon,lat,bs="tp", m=2)+offset(log(exp.)),
random=list(dist=~1),
2013 Jun 07
1
gamm in mgcv random effect significance
Dear R-helpers,
I'd like to understand how to test the statistical significance of a
random effect in gamm. I am using gamm because I want to test a model
with an AR(1) error structure, and it is my understanding neither gam
nor gamm4 will do the latter.
The data set includes nine short interrupted time series (single case
designs in education, sometimes called N-of-1 trials in medicine)
2011 Mar 17
2
fitting gamm with interaction term
Hi all,
I would like to fit a gamm model of the form:
Y~X+X*f(z)
Where f is the smooth function and
With random effects on X and on the intercept.
So, I try to write it like this:
gam.lme<- gamm(Y~ s(z, by=X) +X, random=list(groups=pdDiag(~1+X)) )
but I get the error message :
Error in MEestimate(lmeSt, grps) :
Singularity in backsolve at level 0, block 1
2009 May 27
1
Deviance explined in GAMM, library mgcv
Dear R-users,
To obtain the percentage of deviance explained when fitting a gam model using the mgcv library is straightforward:
summary(object.gam) $dev.expl
or alternatively, using the deviance (deviance(object.gam)) of the null and the fitted models, and then using 1 minus the quotient of deviances.
However, when a gamm (generalizad aditive mixed model) is fitted, the
2009 Jan 22
1
convergence problem gamm / lme
Hope one of you could help with the following question/problem:
We would like to explain the spatial
distribution of juvenile fish. We have 2135 records, from 75 vessels
(code_tripnr) and 7 to 39 observations for each vessel, hence the random effect
for code_tripnr. The offset (‘offsetter’) accounts for the haul duration and
sub sampling factor. There are no extreme outliers in lat/lon. The model
2010 Jun 16
3
mgcv, testing gamm vs lme, which degrees of freedom?
Dear all,
I am using the "mgcv" package by Simon Wood to estimate an additive mixed
model in which I assume normal distribution for the residuals. I would
like to test this model vs a standard parametric mixed model, such as the
ones which are possible to estimate with "lme".
Since the smoothing splines can be written as random effects, is it
correct to use an (approximate)
2011 Mar 10
2
ERROR: gamm function (mgcv package). attempt to set an attribute on NULL
Hello:I run a gamm with following call :mode<-gamm(A~B,random=list(ID=~1),family=gaussian,na.action=na.omit,data=rs)an error happened:ERROR names(object$sp) <- names(G$sp) : attempt to set an attribute on NULLwith mgcv version 1.7-3What so? How can I correct the Error? Thanks very much for any help.
[[alternative HTML version deleted]]
2006 Dec 04
1
package mgcv, command gamm
Hi
I am an engineer and am running the package mgcv and specifically the
command gamm (generalized additive mixed modelling), with random
effects. i have a few queries:
1. When I run the command with 1000/2000 observations, it runs ok.
However, I would like to see the results as in vis.gam command in the
same package, with the 3-d visuals. It appears no such option is
available for gamm in the
2012 Feb 22
1
Gamm and post comparison
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)
2011 Sep 22
1
negative binomial GAMM with variance structures
Hello,
I am having some difficulty converting my gam code to a correct gamm code, and I'm really hoping someone will be able to help me.
I was previously using this script for my overdispersed gam data:
M30 <-gam(efuscus~s(mic, k=7) +temp +s(date)+s(For3k, k=7) + pressure+ humidity, family=negbin(c(1,10)), data=efuscus)
My gam.check gave me the attached result. In order to
2010 Apr 14
2
GAMM : how to use a smoother for some levels of a variable, and a linear effect for other levels?
Hi,
I was reading the book on "Mixed Effects Models and Extensions in
Ecology with R" by Zuur et al.
In Section 6.2, an example is discussed where a gamm-model is fitted,
with a smoother for time, which differs for each value of ID (4
different bird species). In earlier versions of R, the following code
was used
BM2<-gamm(Birds~Rain+ID+
2012 Feb 17
2
Error message in gamm. Problem with temporal correlation structure
HELLO ALL,
I AM GETTING AN ERROR MESSAGE WHEN TRYING TO RUN A GAMM MODEL LIKE THE ONE BELOW.
I AM USING R VERSION 2.14.1 (2011-12-22) AND MGCV 1.7-12.
M1 <-gamm(DepVar ~ Treatment + s(Year, by =Treatment), random=list(Block=~1), na.action=na.omit, data = mydata, correlation = corARMA(form =~ Year|Treatment, p = 1, q = 0))
THIS IS THE ERROR MESSAGE
Error in `*tmp*`[[k]] : attempt to
2012 Dec 07
1
Negative Binomial GAMM - theta values and convergence
Hi there,
My question is about the 'theta' parameter in specification of a NB GAMM.
I have fit a GAM with an optimum structure of:
SB.gam4<-gam(count~offset(vol_offset)+
s(Depth_m, by=StnF, bs="cs")+StageF*RegionF,
family=negbin(1, link=log),
data=Zoop_2011[Zoop_2011$SpeciesF=='SB',])
However, this GAM shows heterogeneity in the