search for: gamm

Displaying 20 results from an estimated 115 matches for "gamm".

Did you mean: game
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)...
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...
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...
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 a...
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="t...
2009 May 27
1
Deviance explined in GAMM, library mgcv
...ntage 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 deviance is not displayed, and only the logLik of the underlying lme model can be derived (logLik(objetct.gamm$lme)), which is not enough to derive the percentage deviance explained because the logLik for the saturated model is not available. Any...
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, g...
2008 Nov 15
1
GAMs and GAMMS with correlated acoustic data
...lso highly autocorrelated. Because of the autocorrelations in data, autocorrelations in GAM residuals (up to 20 lags in some cases), patterns in residual plots from GAM models, and very narrow confidence intervals for the predictions, I feel that GAM results are biased and have attempted to use GAMM. Data and procedure examples: #> fish[1:10, ] Transect yaoalebiom yaosmeltbiom yaobloaterbiom year depth lake x y interval 1 nn_1 12.019655 34.910370110 2.647370 2005 97.07525 2 526601.8 4850206 1 2 nn_1 12.164686 35.331548810 3.982028 2005 98....
2009 Jan 22
1
convergence problem gamm / lme
...ish. 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 we try to fit is: > gamm3<-gamm(count~offset(offsetter)+s(lon,lat),random=list(code_tripnr=~1),family="poisson", niterPQL=200) Maximum number of PQL iterations: 200 iteration 1 iteration 2 Error in MEestimate(lmeSt, grps) : NA/NaN/Inf in foreign function call (arg 1) We tried several things. We ad...
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) from one s...
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). Ho...
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...
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...
2018 Apr 18
0
mgcv::gamm error when combining random smooths and correlation/autoregressive term
I am having difficulty fitting a mgcv::gamm model that includes both a random smooth term (i.e. 'fs' smooth) and autoregressive errors. Standard smooth terms with a factor interaction using the 'by=' option work fine. Both on my actual data and a toy example (below) I am getting the same error so am inclined to wonder if th...
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. [...
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) summary(gammdata$gam) summary(gammdata$lme) anova(gammdata$gam) I can see which variables are significant but I was wond...
2010 Jun 16
3
mgcv, testing gamm vs lme, which degrees of freedom?
...use an (approximate) likelihood ratio test for this? If so, which is the correct number of degrees of freedom? Sometime the function LogLik() seems to provide strange results regarding the number of degrees of freedom (df) for the gam, for instance in the example I copied below the df for the "gamm" are equal to the ones for the "lme", but the summary(model.gam) seems to indicate a much higher edf for the gamm. I would be very grateful to anybody who could point out a solution, Best wishes, Carlo Example below: ---- rm(list = ls()) library(mgcv) library(nlme) set.seed(12...
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-in...
2013 Mar 15
0
Poisson and negbin gamm in mgcv - overdispersion and theta
Dear R users, I am trying to use "gamm" from package "mgcv" to model results from a mesocosm experiment. My model is of type M1 <- gamm(Resp ~ s(Day, k=8) + s(Day, by=C, k=8) + Flow + offset(LogVol), data=MyResp, correlation = corAR1(form= ~ Day|Mesocosm), family=poisson(link=log)...
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
...dichotomous dependent variable (dv) with more than 100 measurements (within-subjects variable: hours24) per subject and more than 100 subjects. The high number of measurements allows me to model more complex temporal trends. I would like to compare different models using GLM, GLMM, GAM and GAMM, basically do demonstrate the added value of GAMs/GAMMs relative to GLMs/GLMMs, by fitting splines. GLMMs/GAMMs are used to possibly improve fits from GLMs/GAMs by accounting for serial dependence. My idea is to use AIC to compare the different models. I’ve noticed that when setting up two se...