Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
137 views

I am having issues with computing a GLMM in R using the lme4 package. The issue is that it is attempting to build the model but the loading stays in a suspended state (The stop sign button just ...
D.C. the III's user avatar
0 votes
0 answers
54 views

I am running a GAM on species detection data for the first time. I would like to see if there is any interaction between time of year and diel period for both male and female of this species. This is ...
orangepeelsoup's user avatar
0 votes
1 answer
560 views

I have a gam in R (mgcv package) with 7 parameters, and one of them is a fixed effect with 30 levels (30 names). I want to analyse the regression coefficients for each name (person), but R numbers ...
leslie roberson's user avatar
3 votes
1 answer
1k views

I am navigating through different packages that let fit non-linear predictors in the context of COX PH models. However, I was looking to produce plots to represent the non-linear relationship between ...
userq8957289475's user avatar
0 votes
1 answer
159 views

I have a data set that looks like this: structure(list(n = c(236896L, 73258L, 75570L, 5684L, 10242L, 2037L, 74194L, 41764L, 288115L, 6728L, 18964L, 5395L, 23192L, 12575L, 39591L, 12566L, 44458L, ...
David Smith's user avatar
0 votes
1 answer
196 views

I have the following binomial (probit) gam using mgcv, which includes y (0 or 1), two continuous predictors (xa, xb) plus the ‘ti’ interactions of a third covariate (xc) with these two predictors. ...
denis's user avatar
  • 962
2 votes
1 answer
715 views

I am checking out the mgcv package in R and I would like to know how to update a model based on new data. For example, suppose I have the following data and I am interested in fitting a cubic ...
Mihai's user avatar
  • 2,997
0 votes
1 answer
85 views

I use R in a jupyter notebook as described in this article. It work's perfectly fine. However, when I fit a GAM using the mgcv library and bam, e.g.: dat <- gamSim(1,n=25000,dist="normal",...
hyhno01's user avatar
  • 177
0 votes
0 answers
278 views

I've got a quick question regarding using the gam function and the predict.gam function in R using the mgcv package. I've got a model built with two predictors and one response. However when I try to ...
Warhawk1987's user avatar
1 vote
1 answer
616 views

I've been experimenting with plotting different GAMMs using the plot.gam function from the mgcv package and draw.gam function from the gratia package. When plotting a GAMM with a beta distribution (...
Mason Wirtz's user avatar
3 votes
1 answer
422 views

I have the following data set: structure(list(Age = c(83L, 26L, 26L, 20L, 20L, 77L, 32L, 21L, 15L, 75L, 27L, 81L, 81L, 15L, 24L, 16L, 35L, 27L, 30L, 31L, 24L, 24L, 31L, 79L, 30L, 19L, 20L, 42L, 62L, ...
CanyonView's user avatar
5 votes
2 answers
2k views

I have two GAMs which have the same predictor variables but different independent variables. I would like to combine the two GAMs to a set of plots where the smooth component (partial residuals) of ...
tolonen's user avatar
  • 77
2 votes
2 answers
2k views

I am using the useful gratia package by Gavin Simpson to extract the difference in two smooths for two different levels of a factor variable. The smooths are generated by the wonderful mgcv package. ...
user2888990's user avatar
0 votes
1 answer
727 views

I want to run a hieratchical GAM in the mgcv package using the gam function. I used the same form of model in brms without problem and I will eventually re-run the same model in brms, but the deadline ...
Julien Beaulieu's user avatar
2 votes
1 answer
2k views

I am interested in implementing a three-way interaction in mgcv but while there has been some discussion both here and on Cross Validated, I have had trouble finding an answer to how exactly one ...
archdata's user avatar
0 votes
0 answers
591 views

I am creating a series of logistic regression models using mgcv and comparing them with AIC(). I have only four variables (socioeconomic class (Socio), sex, year of death (YOD), and age) for each ...
archdata's user avatar
3 votes
0 answers
324 views

I am fitting a gam using the MGCV package in R with the bam function (~60,000 samples) using 3 fixed effects and one random effect. The number of factors for the random effect is very high (several ...
geedigit's user avatar
1 vote
0 answers
514 views

SUMMARY I'm analyzing avian point count data using glmmTMB. I'm trying to estimate year-specific mean abundance for each species. Models with interactions of fixed terms are not working, I think ...
G. Channing's user avatar
2 votes
0 answers
931 views

id:268levels group:10levels I used the gamm4 function of the package gamm4 to fit the following model. gamm4_1 <- gamm4(y~z1+z2+z3+age+height+time+bmi,random=~(1|id)+(1|group),data=data,family=...
thi's user avatar
  • 41
0 votes
0 answers
364 views

I am doing HGAM with the brm function (brms package). For now, I kept the default k = 10, but I want to know if I should set k higher. I know that the function k.check in the mgcv package does that ...
Julien Beaulieu's user avatar
0 votes
1 answer
125 views

id:268 levels group:10 levels Fitted a mixed-effects model using gamm in the mgcv package. Fitted a generalized additive model for age and bmi, but could not read the output of the random effect using ...
thi's user avatar
  • 41
2 votes
1 answer
549 views

I am getting a false convergence on a GAMM using mgcv::gamm when I try to fit models with corARMA functions for correlated error structures. The response data are amounts of precipitation, and are ...
JKO's user avatar
  • 307
1 vote
1 answer
344 views

I have a GAM model where time of day is one of the predictor values. Time is in numeric format, since as far as I understand, mgcv::gam doesn't accept POSIXct class. The model works fine, but I'd like ...
tolonen's user avatar
  • 77
1 vote
1 answer
214 views

I've looked for this information but haven't been able to find it. I assume it's a logit link but I'm not sure.
the_tuppins's user avatar
1 vote
0 answers
67 views

I'm fitting some GAMMs using the 'mgcv' R package. However, when I attempt to include random smooths, I get an error about recursive vs. atomic vectors: Error: $ operator is invalid for atomic vectors ...
MeC's user avatar
  • 463
2 votes
0 answers
202 views

In Tutz and Schmid (2016), example 9.4 (Breast Cancer) they compare several survival models. Among them, is a "fixed effects" model for heterogeneous hazards, where the FEs are constrained ...
SushiChef's user avatar
  • 653
3 votes
1 answer
594 views

The question I have has mostly been answered by the following post: Cannot update/edit ggplot2 object exported from a package (`gratia`) in R. When I refer to the mydraw.gam function, it comes from ...
David Smith's user avatar
2 votes
3 answers
1k views

I'm fitting a gam with mgcv and plot the result with the default plot.gam() function. My model includes a 2D-smoother and I want to plot the result as a heatmap. Is there any way to add a colorbar for ...
Anke's user avatar
  • 633
1 vote
1 answer
2k views

I am running GAMs to understand the spatio-temporal trends in size counts of a Californian mollusc. I have count data as a response to three-way interactions between space & time (lat,long,year) ...
erica_sn's user avatar
2 votes
1 answer
727 views

I have performed a GAM that includes both continuous smooth terms and a categorical variable. I have plotted the model (mod) using plot(mod,residuals=T,all.terms=T,pages=1). This produces plots of the ...
LvG's user avatar
  • 497
2 votes
0 answers
74 views

I struggled with this code to pair different gam' smoothing regression (bs="cs" and bs="tp") using GGally: sel1<-select(rekap,c('Total_Ni', 'Total_Mg', 'Total_Fe', 'CEC', 'pH','...
Moh Zulfajrin's user avatar
0 votes
1 answer
502 views

I am trying to run the following code on R: m <- gam(Flp_pop ~ s(Flp_CO, bs = "cr", k = 30), data = data, family = poisson, method = "REML") My dataset is like this: But when I ...
Julia Moore's user avatar
1 vote
0 answers
377 views

When running a big additive model in R, is there a way to incorporate a progress bar (or similar) that tells me how much time is remaining? Some of my bam's run for many hours, and so it would be nice ...
FlyingDutch's user avatar
  • 1,152
0 votes
0 answers
108 views

I would like to use GAM to run penalized beta regression. Because of my setting, I also need to change the regression of precision, phi. Here is my test code: y <- c(0.0000943615,0.0074918919,0....
Chinyako's user avatar
2 votes
0 answers
552 views

I was working on my GAM model: y <- c(0.0000943615,0.0074918919,0.0157332851,0.0783308615, 0.1546375803,0.5558444681,0.8583806898,0.9617216854, 0.9848004112,0.9964662546) x <- log(...
Chinyako's user avatar
0 votes
1 answer
466 views

I am using a generalized additive model built using the bam() function in the mgcv R package, to predict probabilities for a binary response. I seem to get slightly different predictions for the same ...
rw2's user avatar
  • 1,815
2 votes
1 answer
2k views

I have been having an issue when trying to fit a binomial GAM to data. There are two ways these models can be coded, (i) providing a proportion as the response variable, and the number of trials as ...
tcam's user avatar
  • 75
2 votes
2 answers
2k views

I used log-transformed data (dependent varibale=count) in my generalised additive model (using mgcv) and tried to plot the response by using "trans=plogis" as for logistic GAMs but the ...
Cathrin's user avatar
  • 51
0 votes
2 answers
294 views

I have a vector of twelve predictor variables that I want all possible combinations for: #variable vector d_pred <- c("A", "B", "C", "D", "E", &...
KC Ray's user avatar
  • 97
3 votes
1 answer
1k views

Starting with dummy data for the question: zone <- c(rep("Z1",1000),rep("Z2",1000),rep("Z3",1000),rep("Z4",1000)) scenario <- rep(c(rep("S1",250)...
Thomas Moore's user avatar
6 votes
1 answer
784 views

I am working on a model that includes several REs and a spline for one of the variables, so I am trying to use gam(). However, I reach memory exhaust limit error (even when I run it on a cluster with ...
mpnyka's user avatar
  • 61
1 vote
1 answer
354 views

I have been using the dredge function in the MuMIn package to conduct model averaging on my global GAM model (using bam from the mgcv package), with a priori selected explanatory variables and two ...
mikejwilliamson's user avatar
0 votes
1 answer
1k views

I have a similar issue described here but with the difference that I cannot increase the k-value without getting the error: Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) : A ...
Cathrin's user avatar
  • 51
4 votes
3 answers
5k views

I need to model a smooth term over more than one factor. The by argument allows me to model one smooth per factor level, but I cannot find how to do that over multiple factors. I tried solutions akin ...
Dominique Makowski's user avatar
1 vote
0 answers
147 views

I'm trying to run a gam using the mgcv package with a response variable which is proportional data. The data is overdispered so initially I used a quasibinomial distribution. However because I'm using ...
mikejwilliamson's user avatar
0 votes
0 answers
426 views

I've fit a multinomial logistic regression using gam() and the mgcv package in R. I then used this model to make predictions on new data. The resulting predictions are probabilities because gam() ...
pfadenhw's user avatar
  • 159
1 vote
1 answer
873 views

I have been fitting different hierarchical GAMs (hereafter: HGAM) using mgcv in R. I can extract and plot their predictions for their random effects without problems. Conversely, extracting and ...
Marco Plebani's user avatar
0 votes
0 answers
783 views

I am modeling coastal dolphin distribution with GAMs (package mgcv) and because most "events" modelled result in no sightings- the model has many zeros. The zero-inflated poisson model ...
Ori Galili's user avatar
0 votes
0 answers
473 views

I have an issue similar to the one mentioned here. I'm getting low p-values in my gam check following running my model. mGS_nb2 <- bam(gs ~ SE_score + s(ri) + TL + species + sex + season + year + ...
mikejwilliamson's user avatar
2 votes
1 answer
830 views

I'm running a gamm using bam in mgcv. My response variable is between 0-1 and includes both numbers. For this I felt the betar distribution would be best. However I get an error when trying to run it. ...
mikejwilliamson's user avatar

1 2 3
4
5
11