The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [gamm4]

R package to fit generalized additive mixed models (GAMM) using mgcv and lme4 packages.

Filter by
Sorted by
Tagged with
6
votes
1answer
2k views

QR factorization and linear regression

I have been reading "Generalized Additive Models an Introduction with R" by Simon Wood and have come across a section I'm having trouble with. On page 13 it is stated that the model or design matrix ...
6
votes
0answers
2k views

Interpreting and reporting gamm4 result

I am new to gam, and most of my knowledge comes from this document http://www3.nd.edu/~mclark19/learn/GAMS.pdf. Now I am using generalized addictive model with random effects to model some data, where ...
5
votes
1answer
5k views

Using a gamm4 model to predict estimates in new data

I have been experimenting with gamm4 to derive GAMMs of some repeated measures data. The models looks very nice and seem to give more flexibility than my LMMs. Ultimately I want to compare models ...
4
votes
1answer
1k views

Adding a variance structure when fitting a gamm with Gamma distribution

I am using the code below to fit a gamma GAMM introducing a variance structure that informs the model that variance of the response variable is much larger in one of the levels of the factor coast ...
3
votes
1answer
199 views

Presence/Absence GAMM with penalized smoother convergence/completion problem, data set too large

I am having issues running a GAMM to determine presence/absence with a very large data set (9,000,000 rows x 13 cols) using GAM4 in R. I think the data set may be too large and is causing convergence/...
3
votes
0answers
2k views

How to calculate deviance explained for a general additive mixed model (GAMM)?

I am working with the package mgcv fitting some GAMs with several covariates, and the same models with GAMMs including annual correlation. Applying the ...
2
votes
1answer
193 views

GAMM with fragmented spatial data - presence/absence response

Quite stuck so hope someone could help me in the right direction. Some background for the data: For the last 15 years data have been collected on a specific species during the period from early ...
2
votes
0answers
147 views

GAMM with multiple and crossed random effects

I am new to Generalized additive mixed models (GAMM) and I'm trying to model a behavioral response variable (time spent shading eggs by a nesting bird in minutes ...
2
votes
0answers
305 views

Model Comparison of GAMs using gamm4

I am using a GAM from package gamm4 in R to fit a varying coefficient model for longitudinal data. I have data consisting of ...
2
votes
0answers
960 views

Help interpreting plot.gam in R (gamm4)

I'm not sure this question is better suited for Cross Validated or Stack Overflow, please don't hesitate to tell me if I ask it on the wrong forum. I'd appreciate some help interpreting what shows the ...
2
votes
0answers
2k views

Binomial Temporal GAMM does not converge (R::mgcv)

I am new to both mixed effect and Additive models so I'm sorry if the answer here is trivial. I have data collected on several metabolic chemicals (M1,M2...), covariates (time,Race,Gender...) and ...
1
vote
1answer
435 views

GAMM with Zero-Inflated Negative Binomial - Looking for a package on R

I am looking for an R package to fit Generalized Additive Mixed Models with ZINB distribution, as ZINB is not available in the mgcv package nor in the gamm4 package. I read here that it might be ...
1
vote
1answer
2k views

gam models with random effect R

I am modeling fishery CPUE as a function of a number of a number of covariates using a GAM approach that includes fixed and random effects. I understand that there are limitations with regards to ...
1
vote
1answer
51 views

Irregular time series with multiple sampling sites

I have a dataset of marine debris items (number of items standardized per effort: Items/(number of volunteers * Hours * Length)) taken from 2 main locations (WA and Queensland) in Australia (8 Sub ...
1
vote
1answer
96 views

Does family 'ocat' work with gamm4 in R? [closed]

I am trying to fit a GAMM to ordered categorical data using gamm4 in R. In the help file for gamm4, it says the argument 'family'...
1
vote
0answers
22 views

Negative binomial random effects models (glmmTMB/gamm/gamm4)

Can anyone help please. Am I missing something fundamental here? I would like to test for a Cave and a Category effect in the same model, and I'd like to know if I've specified the random effects ...
1
vote
0answers
42 views

gam/gamm when response variable is complex

I would like to fit a generalized additive mixed model using mgcv or gamm4, but have a response variable consisting of complex numbers where y=a+1i*b. Is this possible, and if so are there any special ...
1
vote
0answers
176 views

Correct way to account for repeated measures and spatial autocorrelation in GAMM (R)

I am using the gamm function in the mgcv package in R to specify a model that predicts abundance with respect to elevation and year based on repeated measures from several sites. My overarching ...
1
vote
0answers
47 views

Determine maxima and minima of fitted GAMM smooth

I have been using gamm4 to model the daily activity pattern of a certain behavior as a binomial response (whether the behavior occurs or not for each hour of the day). I am comparing the daily ...
1
vote
0answers
93 views

R^2 for mixed effect models (both generalized linear and additive)

I have seen from several discussion threads that there are a few ways of calculating R^2 for LMMs and GLMMs - albeit with a caveat for GLMM being that the existing methods work for only gaussian ...
1
vote
0answers
1k views

Generalized additive mixed model in R - specifying a fit function

The data in question comprise two response groups (no response vs. stress signal), different individuals, repeated measures ...
1
vote
0answers
146 views

Can i use a mixture model for when I have an omitted variable?

I plan to fit a GAM or GAMM. There is one categorical variable which I think is important for explaining Y (or Y*), but it is not in my dataset - it is measurable but has not been measured. Can I use ...
0
votes
1answer
581 views

gamm4 what does s() do?

say we have the following: ...
0
votes
0answers
28 views

R: Why does gamm4 reduce the AUC compared to lme4?

Problem: I'm currently working on binary classification with R. I found that gamm4() from gamm4 package would give worse results than ...
0
votes
0answers
22 views

Can I compare the AIC of gamm models with s(x) and s(x,by=z) predictors?

I am fitting a set of generalized additive mixed models using gamm or gamm4 packages for R, and in particular want to compare the AIC of two models of these forms: mod1 <- gamm(y~s(x), random=~(1|...
0
votes
1answer
84 views

Using gamm4 on zero-inflated count data with Tweedie or zero-inflated Poisson distributions

I'm working with a dataset with a large number of zero-counts on the response variable. This dataset consists of qualitatively coded interviews in a number of important categories, but many of the ...
0
votes
2answers
301 views

Gamm residuals patterns: temporal and spatial

I'm trying to fit a GAMM model with this dataset, which can be downloaded here: https://ufile.io/8umh6 . The dataset consists of 60 pixels sampled in two different areas: BAR and MON, 30 for each one. ...
0
votes
1answer
194 views

Getting better p-values for a gam model with multiple explanatory terms using bootstrapping

I'm running a GAMM in R on count data with multiple explanatory variables, including both continuous variables with smoothers and factors, a random effect, and a Poisson distribution using the gamm4 ...