Questions tagged [gam]

Generalized additive model (GAM) is a generalized linear model (GLM) in which the response variable depends on unknown smooth functions of some predictor variables.

0
votes
0answers
7 views

GAM betar, Deviance explained is more than 100%?

It is my first time using GAM, However I am having a challenging issue: I am getting “Deviance explained = 102%” and I don’t know how we suppose to interpret it.Does it relate to the warning message ...
0
votes
0answers
8 views

'aqmm' - sample R code & output interpretation? [on hold]

Does anyone have sample R codes and outputs for 'aqmm' (additive quantile mixed model)? This would help me visualize how to set up my model and interpret outputs. I'm trying to build an additive ...
2
votes
1answer
17 views

Should I use Poisson or Gaussian family in GAM?

I would like to ask if I am right to use a Gaussian family in my GAM analysis. I have some count data of the number of animals captured per 100 traps, which is not normally distributed. Then I did a ...
0
votes
1answer
9 views

Plotting summed effects of factor levels in interactions in a GAMM model

I am new in GAMM and I am analyzing a data to find the effect of year, tree species and their interaction on richness of insects on the trees. I expect that year will have an overall nonlinear effect. ...
1
vote
1answer
19 views

Need to center continuous variables in GAMs?

This is just a quick question, but I remember reading somewhere that continuous variables used in splines for generalized additive models ought to be centered (especially for GAMs rather than just as ...
0
votes
0answers
22 views

Can someone explain me how cumulative association in distributed lag models works?

I'm trying to fit some distributed lag models with dlnm package in R. When I specify cumul=TRUE, I obtain extra parameters ...
4
votes
0answers
43 views

When to choose regression splines over smoothing splines? [duplicate]

I am currently studying how to model covariates beyond linearity in order to use them with GAMs for regression / classification purposes. Talking about splines, two types were presented: regression ...
0
votes
1answer
13 views

Potential use of GAM's in Python to evaluate dataset

I'm working with a dataset of >100k rows that includes 4 columns: ['Person','x_value','y_value','binary_response'] My goal is to able to run tests to evaluate ...
0
votes
0answers
22 views

solution to non linear correlations in glm

I'm doing a glm to test the relation between one variable with diferent climatic variables. Nothing is significative and I think maybe the problem is that the relation between the variables is not ...
2
votes
1answer
22 views

what are the intercepts in mgcv's ordered-factor difference smooths?

I aim to plot the gam() model fit back on the original data. My impression was that gam() has special treatment for ordered ...
0
votes
0answers
19 views

GAM model residuals

I have a huge problem with my model. I did a GAM Model with negative binomial distribution (with mgcv library). Now I want to do an overdispersion test but I think that this doesn't exist for ...
0
votes
0answers
9 views

Confidence in model selection

I have a Gam model built for a time series study over 15 study sites for ecological analysis. I have run the model and I have a significant intercept, ecologically sound significant results, 55% ...
1
vote
0answers
21 views

GAM goodness-of-fit under covariates shift

I have GAM models that were fitted using PyGAM and its defaults for fitting a linear GAM. To validate the model I do a leave-one-out cross-validation looking at either a Spearman's rank correlation ...
3
votes
1answer
24 views

How does one intuitively interpret significance of splines/GAM term?

Consider the data dput here. I can predict y from x using a cubic spline: ...
1
vote
1answer
32 views

GAM discrete time survival prediction in R [closed]

So I've been trying to perform a discrete time survival analysis in R. I have been using the discSurv package to generate the augmented data matrix for the full ...
2
votes
1answer
22 views

significance of difference smooths

I am working to understand what is represented by the standard errors and confidence intervals of smooths of ordered factors. In this toy example, I wish to determine (1) the overall form of the trend ...
1
vote
0answers
18 views

concurvity in presence of random smooths [closed]

I am trying to fit a GAMM containing per subject random smooths using the bam function in mgcv as follows: ...
2
votes
1answer
35 views

Why does “ smooth term” have “parametric” effect?

I read a blog about Generalized Additive Model (GAM). In this blog, the author used summary(gam1), then some information is printed: ...
0
votes
0answers
26 views

zero inflated presence absence binomial GAM in R

I am fitting a binomial GAM using mgcv in R. My data is presence (1)/ absence(0) of dolphin acoustic detections in 10 minute time windows over ~1 year period. However, I have only ~750 presences to ~...
1
vote
2answers
35 views

Is there a maximum number of independent variables for generalized additive model?

I noticed that we sometimes pick the indenpendent variables into the GAM model, but don't consider if we have add "too many" of them. For example, if I have a dataset with 100 observations, what is ...
0
votes
0answers
8 views

Performing a GAM with correct error distribution and smoothing functions

I'm applying a GAM from package mgcv using two continuous explanatory variables with a binomial response. What would be the best error distribution to use (Family and link)?
1
vote
1answer
51 views

Using GAM outside statistical modelling software (in-datatabase, outside R)

Question to advanced users, math pros/programists. Can you help me understand this explanation how to use GAM outside R? As I understand very vaguely, a matrix of parameters is being exported and ...
0
votes
0answers
39 views

Application of GAM on large dataset

I was suggested that my questions were too broad. As I commented below, I have nearly a million data points and perhaps a hundred variables. This may be a very basic modeling question: I am curious to ...
0
votes
0answers
9 views

How does one interpret r-sq (adj) versus deviance explained in GAMM creation?

I am running some models for my master's dissertation using backwards stepwise regression of GAMMs. I have six total models. I have a base model with several significant variables; the r-sq (adj) = -0....
0
votes
0answers
11 views

Output of a GAM in R

Please I need someone to kindly explain this result from Poisson GAM for me. Specifically, I need your support in interpreting edf and Ref.df, and the deviance explained. (Sorry that for the poor ...
1
vote
1answer
35 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
41 views

Model selection for GAM in R

Apologies in advance I new to this forum and to GAM models. I am trying to model complex ecological data. I have programmed a lot of GAM models using the mgcv ...
0
votes
1answer
27 views

Why the dependent variable as a time series in GAM should be log transformed?

I found in Section 3.1 of this paper (see ), the author used log(y) due to "the context of a concentration time series". A book (Hastie and Tibshirani, 1990) is cited, however I cannot get this book. ...
2
votes
3answers
138 views

Problems interpreting GAM output

I have been advised to run General Additive Models to be able to describe trends in my data, my data being animal harvest numbers by year. I have done so, but have a problem with interpreting the ...
8
votes
2answers
259 views

Different ways of modelling interactions between continuous and categorical predictors in GAM

The following question builds on the discussion found on this page. Given a response variable y, a continuous explanatory variable ...
0
votes
0answers
41 views

Practically speaking, what do the three concurvity measures provided by the package mgcv mean?

I am using the R package mgcv to examine the association between asthma visits to the ER and air pollution. Most of my terms are parametric, with the exception of time, which is a smooth cubic ...
3
votes
0answers
43 views

How can I incorporate a known measurement error per group into a GAM?

I am trying to investigate surface changes using a time series of 3D point clouds. Due to data volume, I am segmenting the point cloud in small (eg. 50cmx50cm) areas and for each compute a generalized ...
2
votes
1answer
80 views

Random effects in GAM

I'm modelling some biological function, outcome, in patients over 8 hours. Over time, I measure two additional covariates x and ...
1
vote
0answers
25 views

How to measure the amount of confounding in tensor interaction in GAMs?

I am interested in fitting an additive model with tensor interaction terms. This construction is described in Wood (2006) and used in the mgcv ...
0
votes
1answer
29 views

How to plot mortality at age curve using lifespan data

I have a table with the lifespan of multiple individuals from a species and would like to use this data to plot a mortality rate curve, similar to that shown in figure 1 of this study:https://www....
2
votes
0answers
22 views

How do I use GAMs in instrumental variable analysis?

I have an outcome $Y$, a risk factor $X$, and an instrument $Z$. In a two-stage least squares (2SLS) setting, the first stage is $$ X=Z + \varepsilon $$ and the second stage uses predictions from ...
3
votes
1answer
45 views

Hard in calculating predictor‘s Relative Importance for GAM?

Although there is no agreement upon "relative importance for predictors" with (even) linear models (one possible definition: lmg method), I would still want to know whether there are some acceptable ...
0
votes
2answers
53 views

What is the acceptable level of concurvity?

I got the following concurvity values as a result of a GAM model. ¿are they high or low? I don't know what is the acceptable value... Thanks, Karla .
0
votes
0answers
37 views

Step failure in theta estimation using bam() in mgcv

I am using ?bam in mgcv 1.8-24, and when I'm using the negative binomial family I sometimes get a warning that says: ...
2
votes
0answers
54 views

Which index is preferred in GAM, “R-sq” or “Deviance explained”?

I use mgcv package in R to build a Generalized Additive Model. When looking at results of (e.g., summary()), there are two ...
1
vote
1answer
31 views

Why 2nd derivative is “squared” to represent wigglyness in GAM?

In David Miller's presentation (here, slide 21), he drew 1st derivative and 2nd derivative of a function. Then he said (slide 22) that grey part can is : $ \int (\frac{\partial ^{2}f(x)}{\partial x^{...
1
vote
1answer
36 views

Differences of GAMs and GLM

I'm currently looking at a dataset and have to create a model to predict outcomes for whose values are non-negative. I'm looking at using a GLM or GAM for my data though I'm unaware of what would work ...
2
votes
1answer
121 views

Does GAM (Generalized Additive Model) have collinearity problem?

There is collinearity effect in linear regression methods. For example, this question is about collinear predictors in GLM. But GAMs are nonlinear, do we need to check the collinearity of independent ...
1
vote
0answers
110 views

How partial residuals in “plot.gam” are calculated?

Take mtcars as an example. I build a GAM model between mpg (dependent variable) and disp and ...
1
vote
1answer
37 views

Why trend between smooth plots (of GAM) and scatter plot is the opposite?

Below is an example using mtcars. ...
0
votes
1answer
40 views

mgcv::gam(). ANOVA decomposition of a factor-by-variable interaction

Suppose: y is a continuous response variable. z is a factor variable, and x is a continuous variable. For example, ...
1
vote
1answer
98 views

Confidence Interval for non-smooth term in gam (mgcv)

I fitted a gam model in mgcv package and now want to get the confidence intervals for the non-smooth term. ...
1
vote
0answers
30 views

Standarized coefficients of a general additive model GAM

I am using a GAM model to study the effects of time (in weeks) and quality parameters (qp1, qp2, qp3 and qp4) on a response variable. Since the effect of time is modelled best by a spline, I am using ...
0
votes
0answers
7 views

Does the parametric coefficient from GAMM compare patterns between groups over time, or just the means?

I have data consisting of the distance cats travelled each hour, collected over four or five days per cat. The cats were measured in different seasons and I want to know whether the activity of the ...
0
votes
0answers
16 views

Model Deviance lower than Residual Degree of Freedom

I am trying to calculate the Variance inflation factor (VIF) for a Generalized Additive Model (GAM). The GAM model contains both constant terms and splines. The VIF is defined as Deviance of model ...