Questions tagged [gamm4]
R package to fit generalized additive mixed models (GAMM) using mgcv and lme4 packages.
46
questions
1
vote
1
answer
136
views
Is my GAM modeling longitudinal change appropriately?
My data includes the following:
Y which is a physiological measure
Age continuous
Gender ...
2
votes
1
answer
102
views
What to do when GAMM is linear?
I have the following gamm4 output:
This is longitudinal data modeled as:
...
3
votes
1
answer
141
views
How to interpret non-signicant intercept but significant smooth terms with GAM in R?
I have the following gam model:
...
2
votes
1
answer
97
views
AIC comparison of GAMM and LMM: Is it valid?
I have 2 models, using exactly the same variables, one fitted as a linear mixed model (LMM) and another fitted as a generalised additive mixed model (GAMM). I am interested in the fixed effect X and ...
1
vote
0
answers
51
views
GAMM with BETAR(Link = "Logit") [closed]
I'm trying to use betar in gamm4 models but keep hitting an error. As far as I can tell, betar is one of the families that should be available - can anyone identify why I would keep hitting this error?...
1
vote
0
answers
50
views
Interpreting a GAM model output
I have been working on a GAM regressing model with interaction and the summary output have several parameter coefficient and also a some approximate significant of smooth terms. Do u need to interpret ...
0
votes
2
answers
129
views
use GAMM models for full circular wind direction data
using a GAM modeling approach enables to include circular data as fixed effects. I wish to analyze the effect of wind on the flight behaviour of birds. In order to do so I want to add wind speed and ...
4
votes
2
answers
104
views
GAM with many binary factors
I am trying to model the blood glucose response at 15-minute intervals after a meal. The meal event has many continuous variables (like time of day, body weight, etc) and many binary variables (like ...
1
vote
0
answers
44
views
Decomposition of r square into fixed and random effect in a GAMM (mgcv)
for a paper I estimated a generalized additive model using R's mgcv. One reviewer now asks whether it would be possible to report a marginal and conditional r square instead of a global r square to &...
0
votes
0
answers
60
views
GAMM4 and interaction between two continuous variables
We want to run a general additive model with fixed and random effects. We have a brain measure (Diff) done at four different ages (Age) on the same subject and a behavioural measure (Beh) done only ...
3
votes
1
answer
582
views
Basis dimension (k) too low for the smooth term in a GAMM
I am running a generalized additive model (GAM), but when I check the model diagnostics (using gam.check()) I run into problems. I have tried adjusting the value ...
1
vote
0
answers
61
views
Times series forecasting , why predictions are the same over time
This is my first time posting here , I am doing an energy consumption forecast , my data contains the energy every hours I have two seasonality ,every 24 hours and every 7 days (daily and weekly).
I ...
2
votes
0
answers
46
views
Adding interaction term with multiple variables in gamm4?
I am using gamm4 model from R package gamm4 (random slope=age_m, random intercept=FLEHS_ID and groupdescription):
m1 I only look ...
2
votes
1
answer
179
views
Is GAM appropriate for these data
I am strangling to find the right modeling method for my data.
Short explain of the dataset : I have a variable called alpha diversity ( Alpha diversity refers to the average species diversity in a ...
1
vote
0
answers
38
views
Error in X %*% diag(diagU[indi]) : non-conformable arguments with GAMM4 [closed]
I've started working with gams recently and I am having a bit of trouble with gamm.
I built my model with the gam function and everything runs smoothly with the following code.
gamtot <- gam(...
3
votes
1
answer
613
views
Specifying random effects using GAMM4
I am missing something when trying to specifiy random effects on Gamm4.
Reproducible example:
Consider the following simulated data:
...
1
vote
1
answer
377
views
INTERPRETATION OF GRAPHIC RESULTS OF GAM IN R
Hello I am trying to adjust a GAM in R. I am new to GAM and I am trying to see the relationship that can exist through time in 57 river stations that are divided into Impacted and not previously ...
1
vote
1
answer
552
views
How to interpret the plotted difference of in-factor smooths
I used the gamm4 R package to analyze the location effect on heart rate over time (Inc_age), including some linear co-variates and a random effect. My model looks like this:
...
1
vote
0
answers
175
views
Using and interpreting GAMMs
I have been struggling to fit a model using gamm4.
context of my study
I'm trying to fit a 'gamm binomial' to model the probability of having a new component in a group. In my data, components are ...
0
votes
0
answers
397
views
how to interpret the smoothed effect of time in GAMM models
I have recently taken a plunge into the world of Generalized Additive Mixed Models (GAMMs) after learning that including the quadratic and cubic fixed and random effects of time to understand students'...
1
vote
0
answers
433
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
1
answer
225
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
1
answer
909
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 ...
2
votes
0
answers
87
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 ...
2
votes
0
answers
580
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 ...
6
votes
1
answer
1k
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 ...
4
votes
1
answer
2k
views
GAMM with Zero-Inflated Negative Binomial - Looking for a package in R
I am looking for an R package to fit Generalized Additive Mixed Models (GAMMs) with ZINB distribution.
ZINB is not available in the mgcv package nor in the ...
1
vote
0
answers
59
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
1
answer
262
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'...
2
votes
0
answers
945
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 ...
0
votes
2
answers
814
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. ...
1
vote
2
answers
484
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 ...
2
votes
1
answer
313
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 ...
3
votes
0
answers
1k
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 ...
1
vote
1
answer
116
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 ...
4
votes
1
answer
292
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/...
1
vote
1
answer
3k
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 ...
5
votes
0
answers
3k
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
0
answers
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
0
answers
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 ...
12
votes
0
answers
3k
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
1
answer
2k
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 ...
0
votes
1
answer
806
views
gamm4 what does s() do?
say we have the following:
...
1
vote
0
answers
156
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 ...
8
votes
1
answer
3k
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
...
5
votes
1
answer
7k
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 ...