Skip to main content

Questions tagged [generalized-additive-model]

Generalized additive models (GAMs) are regressions that estimate nonlinear patterns in data. This tag should not be used with the `glm` tag unless the question explicitly deals with comparison of the GAMs with GLMs.

Filter by
Sorted by
Tagged with
0 votes
0 answers
24 views

GAM with proportional response data and multiple categorical predictors and autocorrelation [closed]

I'm new to GAMs and am trying to figure out how to parameterize and interpret models where the response variable is percent of salmon migrating through a given route and I think there might be ...
Serena Wong's user avatar
2 votes
1 answer
118 views

Confusion about what is treated as the "reference" level in GAM using by= ordered factor in smooth

I have some confusion when trying to follow the example (https://fromthebottomoftheheap.net/2017/12/14/difference-splines-ii/) of using ordered factors in mgcv to get p-values for difference smooths. ...
SRHUMW's user avatar
  • 23
0 votes
0 answers
53 views

Mixed Effects models approach?

I've been debating on a more deliberate diving into working with mixed models but I am slowly feeling overwhelmed. I've been going through resources (tutorials, webpages, books, etc) and have feeling ...
Paul Julian's user avatar
1 vote
1 answer
36 views

My data is clustered in space, how can I account for that in a GAMM?

I am modelling whether a bird nest is build or not based on the date it was built, the geographical coordinates where the nest was built, and using the year when the nest was built as random effect - ...
Teresa's user avatar
  • 21
-1 votes
0 answers
17 views

Is factor with two levels set as random effect okay in GAMs? [duplicate]

a. Can covariate that are factors/categories that have 2 levels, such as yes/no or presence/absence, that also change spatial location from year to year have a smooth basis of “re” (bs=re)? Should it ...
frog_dan's user avatar
5 votes
1 answer
154 views

When to choose GAM over GLMM and how to include random effect into GAM

This is a follow-up question to this question. Here is a description of the dataset: the outcome variable is the number of contacts per participant for two periods before lockdown and under lockdown. ...
Chao's user avatar
  • 83
3 votes
1 answer
43 views

Modelling spatial autocorrelation with GAMs

the topic of spatial autocorrelation (SA) within the context of generalized additive models has already been discussed in several posts within this forum, see e.g. Why does including latitude and ...
August Edwards's user avatar
2 votes
0 answers
20 views

In MVGAM, how can I model an interaction between 1 continuous variable (Abundance), 1 discrete (time in days) and 1 factor (the Genus of eukaryotes) [closed]

I'm working in microbial ecology and I'm trying to modelize the influence of the abundance of several genuses on a single genus of interest through time in a situation of primary succession of ...
Samuel beauregard-tousignant's user avatar
0 votes
0 answers
19 views

Effects Contrast Matrix for Interaction with Multiple Grand Means

I want to include an interaction between two factors: area and house_type, in my GAM (MGCV), I hope to make a sum-to-zero ...
statmaj's user avatar
  • 76
2 votes
2 answers
79 views

Issue fitting and plotting GAM with soap film smoother

I am having an issue fitting a gam with mgcv in R and am looking for some help. In brief, I have a dataset that contains numbers of fish from one of two groups (Hatchery or Wild) that were detected at ...
Jack B's user avatar
  • 23
1 vote
0 answers
51 views

gamm and gamm4 give very different smooth term results for mixed models with factor-smooth interaction

I am analyzing an longitudinal dataset which has two groups (patient vs controls; ordered factor) with brain volume data over time. Participants entered the study at different ages and have varied ...
adrianneurosci's user avatar
1 vote
1 answer
30 views

Asking for clarification on how to interpret the output of a Generalized Additive Model with interaction terms

I'm very noob to GAM modeling, so I needed to clarify some questions, so thank you in advance :) I want to model bacterial growth (numeric) as a function of the concentration (numeric) of two drugs (...
2au's user avatar
  • 11
3 votes
1 answer
66 views

Factor-smooth interactions in generalized additive models

I have a very simple question regarding the continous factor-smooth interactions implement in the mgcv package in R: https://stat.ethz.ch/R-manual/R-patched/library/mgcv/html/factor.smooth.html ...
Fuffi's user avatar
  • 31
1 vote
1 answer
70 views

Generalized additive model which interacts with mean of response

I am currently constructing a model to predict house prices based on the GAM framework. The model is based on fitting a data set of 222299 house sales with the following information: Response variable:...
August Edwards's user avatar
1 vote
1 answer
75 views

GAM: Smooth and factor interaction

I am currently working on a GAM. It includes a smooth-factor interaction. I am trying to decide which function is the one I need. ...
Laura's user avatar
  • 51
0 votes
0 answers
38 views

GAM analysis two ways: as percent survival using normal dist and as alive/dead using binomial dist but getting drastically different results

My question relates to salmon population data. Im trying to understand how ocean variables affect the return of salmon. Ive analyzed the data two different ways. The first, the response variable as a ...
Don Segundo's user avatar
6 votes
1 answer
146 views

Model checking for generalized additive models

I am currently constructing a GAM model to describe house prices. The dataset is a collection of roughly 200K house sales in a particular geographic region. Based on previous suggestions in this forum,...
August Edwards's user avatar
0 votes
0 answers
20 views

Correcting data using model residuals

I am trying to follow a method from a paper to correct my data for technical effects. The method suggests to take the central portion of my data to guard against outliers (which I can do), fit a ...
Alan's user avatar
  • 55
1 vote
1 answer
47 views

Can you use a percentage as the dependent variable in general additive models?

This is more a general question about statistical modeling rather than a project specific question. Can the dependent variable be a percentage in a generalized additive model (GAM)? Is there a ...
DaniH's user avatar
  • 45
1 vote
0 answers
86 views

Estimation in generalized additive models

I'm currently trying to learn about generalized additive models (GAMs) with the book Generalized Additive Models An Introduction with R by Simon N. Wood. However, I have some questions regarding the ...
Dude3400's user avatar
2 votes
1 answer
41 views

How to model the interaction between two continuous variables and two factors using gams with mgcv? [closed]

I was wondering how I could model the effect of two continuous variables X1 and X2 and two factors F1 and F2 and their interaction on a outcome Y using gams. What I primarily want to know is (in ...
Boussens-Dumon Grégoire's user avatar
3 votes
1 answer
61 views

Proving that a natural cubic spline optimizes a smoothing problem

The GAM book by Hastie and Tibshirani 1990 claims that the natural cubic spline is the function $f$ which minimizes the least squares objective $$ \sum_{i=1}^n(y_i-f(x_i))^2 +\lambda\int_a^b f''(t)^...
Maverick Meerkat's user avatar
2 votes
1 answer
29 views

Incorporating site-level random-effects and 2-dimensional spline of coordinates in a GAM in R

When building a Generalized Additive Model model using gam() from the mgcv package in R, one ...
geoscience123's user avatar
-1 votes
1 answer
55 views

Transformation of negatively skewed data [closed]

I asked a question and thanks to your feedback I noticed how unspecific and not thought through enough it was. So, I am trying to be more specific. I am currently trying to calculate a moderation ...
Laura's user avatar
  • 51
3 votes
1 answer
96 views

GAM in R, model and assumptions

I have the following problem: My moderation analysis shows non-linearity. Thus, I try to fit a GAM. I have several problems: My DV is left-skewed with many high and just some low values. When fitting ...
Laura's user avatar
  • 51
2 votes
1 answer
43 views

How to address multicollinearity when adding random effects in gam model and include random slopes?

I'm working with a generalized additive model (GAM) using the mgcv package in R. My dataset includes measurements collected over several years at different sites. I ...
maycca's user avatar
  • 355
6 votes
1 answer
117 views

Valid confidence intervals in GAM’s using shrinkage estimation

In this blog article: https://www.fharrell.com/post/improve-research/ it states: “The frequentist paradigm does not provide confidence intervals or p-values when parameters are penalized”. I was ...
user167591's user avatar
1 vote
1 answer
37 views

How can I do GAM piecewise in R? [closed]

I have some data $(x_i,y_i)_{i=1}^N$ which looks like a sigmoid curve in the xy-plane. Kind of like this: I think my data is homoscedastic normal distributed. My data has much larger variance than ...
Mikke Mus's user avatar
  • 113
2 votes
0 answers
36 views

How to appropriately model complex structured, multivariate data [closed]

This is an extension of this question I posted earlier. The general data I introduced there is the same. The structure/nature of my data is: y ... my response variable of interest x ... my main ...
Anke's user avatar
  • 301
0 votes
0 answers
31 views

Meaning/Definition of Smoothing

I am self-studying Vector Generalized Linear/Additive Models (mostly) via Yee, T. W. (2015) "Vector Generalized Linear and Additive Models: With an Implementation in R." This book has many ...
TJM's user avatar
  • 153
1 vote
0 answers
34 views

Rel. contribution of each term to deviance explained (in GAM)

I have seen this and similar questions all over the place, but no really satisfying answers: How can we quantify the contribution that each term in a GAM (using mgcv package) adds to the total ...
user_20201213's user avatar
5 votes
1 answer
215 views

VGAMs/VGLMs vs Multiple GAMs/GLMs

I am self-studying Vector Generalized Linear/Additive Models (mostly) via Yee, T. W. (2015) "Vector Generalized Linear and Additive Models: With an Implementation in R." I think I am ...
TJM's user avatar
  • 153
1 vote
1 answer
35 views

Interpreting GAM intercept (mccv's bam() function in R)

I am very new to GAMs (and, frankly, regression models in general), and I am struggling to understand the model summary I get when using the bam() function from the mgcv package in R, more ...
aevilok's user avatar
  • 11
3 votes
1 answer
44 views

How do you model the two-way interactions between a continuous variable and two factors but not the three-way interaction with GAMs?

For the example, let's suppose I'm trying to model the level of activity of some frogs depending on a continuous variable (water temperature) and two factors : their sex (M or F) and the period of the ...
Boussens-Dumon Grégoire's user avatar
0 votes
0 answers
24 views

R/mgcv: GAM where some dependent variables are function of each other

I am trying to create a model using mgcv of an explanatory variable based on multiple other variables that are cross-correlated, and have high concurvity. Essentially, I want to explain a gas flux ...
user412561's user avatar
0 votes
0 answers
13 views

Set a monotonically increasing or decreasing relationship with GAM for binomial data

I am working with observation data and climate variables. I expect that the relationship should be linear or non-linear with a single direction of influence. Instead the output from ...
user3386170's user avatar
5 votes
1 answer
123 views

Using GAM for hotspot mapping

I’m going to preface this with, I’m no Generalized Additive Model or spatial statistics expert … I know enough to be “dangerous” … maybe that’s a bad thing 😉 Today I had a little bit of a thought ...
Paul Julian's user avatar
0 votes
0 answers
22 views

Combing multiplicative and additive effects in GAMs or GLMs

I am currently modelling a data set of house sales prices, P, as a function of various characteristics such as location, house size etc. etc. The list of explanatory variables can be divided into two ...
August Edwards's user avatar
2 votes
2 answers
62 views

Which way to correct for autocorrelation in GAM in timeseries (corARMA/corAR1/corCAR1)?

I was wondering if there are any noteworthy differences in how to correct for $\text{AR}=1$ in a GAM, where time is continuous considering the three different methods here (the data has been collected ...
aim6789's user avatar
  • 77
0 votes
0 answers
41 views

Modelling spatiotemporal data with GAMs (part II)

this post is a continuation of my previous question about modelling spatiotemporal data with GAMS: Modelling spatiotemporal data with GAMs In short, I am currently modelling a data set of house prices,...
August Edwards's user avatar
2 votes
1 answer
71 views

Understanding effect plots of GAM with categorical interactions and differing range of predictor variable

I'm trying to model complex relationships of a continuous predictor variable that has interactions with two categorical variables. I have skew in my samples as in that I have differing predictor ...
Anke's user avatar
  • 301
0 votes
0 answers
46 views

How to create a GAM with interation term for a soap film smoother

I am interested in creating a GAM that contains a soap film smoother that can also vary in time. Below is an example using synthetic data. I start by creating data with two spatial signals, which are ...
Marc in the box's user avatar
3 votes
1 answer
100 views

Interpretation help of summary from basic GAM models with random smooths

I have run two GAM models to see if there is a non-linear relationship between my response variable (blood metabolites) and time. I'm currently accounting for individuals (ID_new) with a random smooth ...
Adam9's user avatar
  • 33
4 votes
1 answer
54 views

Can GAM with Tweedie distribution be used for a binary response?

I am trying species distribution models with GAM. The data set is the presence/absence of a species and environment variables in each grid. In the paper of Virgili et al. (2018), the authors suggested ...
Terpsiphone's user avatar
4 votes
1 answer
48 views

Abnormally large confidence interval with binomial gam when p->1 at max of predictor range

I am running a gam (mgcv in R) to model a non-linear effect of time on a binomial reponse (positive or negative sample). This is a minimal example of such a model: ...
Lars M. Korslund's user avatar
2 votes
1 answer
98 views

Causal Mediation Analysis with treatment smoothed in the outcome stage and linear in the mediator stage

I am considering a mediation analysis that looks like the following in r: ...
flâneur's user avatar
0 votes
1 answer
49 views

Manual specification of knots vs bs() for Piecewise regression

I am learning how to specify and plot piecewise regressions and have encountered a confusing situation. Namely, I have specified the knot for a piecewise regression using 2 methods: (1) manual and (2) ...
Yat-Hon's user avatar
  • 13
3 votes
3 answers
90 views

Interpreting Poisson GAM for epidemiological model

I'm working on a project where I investigate the relationship between PM2.5 (a form of pollution) and ischemic stroke hospitalization (i.e. number of hospitalizations total, collected per day). My ...
user1141170's user avatar
0 votes
0 answers
60 views

Handling missing values in GAMs

I am currently fitting a GAM-model, which assumes that the price of a house P can be modelled as a sum of smooth effects from different distances $d_{1}, d_{2}, ...$, e.g. distance to coast, lake, ...
August Edwards's user avatar
0 votes
1 answer
64 views

Nonparametric version of lme- gamm function in R

Is there a non-parametric version of a linear mixed model? I've seen some people cite gamm in R as one but unsure of how I would go about using it. In R, the code I ...
Kiara H's user avatar

1
2 3 4 5
21