Skip to main content
Filter by
Sorted by
Tagged with
-3 votes
0 answers
41 views

I am using the scam library in R to fit an SCAM model to my data. If my model contains depth, then I get NA in salinity. If my model does not contain depth, then I get an estimation for salinity. Why ...
adrianmnc's user avatar
Advice
0 votes
2 replies
51 views

I have a dataset with around 10,000 continuous variables (gene abundances) in 200 samples, and also some parameters of these samples (e.g., pH). I am trying to see if there are any genes whose ...
ALG's user avatar
  • 322
0 votes
0 answers
31 views

I have successfully implemented OAuth 2.0 authentication between GAM and Keycloak. Login works perfectly. What already works: ✅ Full OAuth 2.0 authentication ✅ Login and redirection working ✅ User ...
Alfredo Henrique Pina's user avatar
0 votes
0 answers
34 views

I am attempting to figure out how to perform multiple imputation using the mice package when I am fitting a generalized additive model. I have a fully observed continuous response variable with 4 ...
sandgrove43's user avatar
2 votes
1 answer
69 views

I am plotting a nonlinear generalized additive model (gam) using R's mgcv package: library(mgcv) V <- rep(1, nrow(dt) fit <- gam(cbind(V, group_number) ~ s(time_elapsed, exposure_group, bs='fs'...
Stefan Verweij's user avatar
1 vote
1 answer
56 views

I am running a gam model with a soap smoother mod_aut_X10 <- bam(occurrenceStatus ~ s(x, y, bs = "so", xt = list(bnd = shap_bnd_ls, nmax = 1000)) + s(...
mikejwilliamson's user avatar
2 votes
1 answer
137 views

In the documentation for mgcv::pcls(), an example of constructing a monotonically increasing gam model is provided with the following code: set.seed(1234) # added for reproducibility in this post only ...
langtang's user avatar
  • 25.3k
1 vote
1 answer
82 views

I'm using a variogram to try and detect un-accounted for temporal auto-correlation in my model, but it shows the same pattern for all group levels (fSite). I allowed each fSite to have it's own trend, ...
Nate's user avatar
  • 489
1 vote
1 answer
101 views

I am having problem running a classification (binary outcome) gam model using the additive package in combination with tidymodels. I have tried to follow the creator of additive's GetStarted.Rmd ...
Chad Apol's user avatar
0 votes
0 answers
89 views

I'm building a GAM via mgcv, which takes days to build. Is there any way to know how much of the model has been built just to get an indication of what is left? Can I print all details during the run ...
ella's user avatar
  • 201
0 votes
1 answer
146 views

As far as I know, mgscv's vis.gam does not feature an argument like exclude = c("s(id)", ...) to exclude a random effect s(id, bs = "re") of a GAMM from the prediction. Is there ...
David's user avatar
  • 107
1 vote
1 answer
65 views

I created this plot using tensor smooths.. I would like to add a visualization of the data density along the x-axis and z-axis. Ideally, this could be done with either: A rug plot on the respective ...
Fabian.m's user avatar
1 vote
0 answers
57 views

I have quite complicated additive models (GAMs) to be processed in R. Since it already takes several days (not finished yet) for even one model, and I would like to process some 100s, I would like to ...
Maki's user avatar
  • 119
0 votes
0 answers
56 views

I am trying to run a GAM that includes 8 input variables (see code below). I first ran the model without accounting for any random effect and the gam.check() appeared to be a good fit. After I add the ...
Tabatha Cormier's user avatar
0 votes
1 answer
66 views

I have a small (n=28) dataset of three seabird occurrence count data and have run a hurdel GAM model (using mgcv::gam()) with first using a binary model with presence/absecene, and then a negative ...
daragh brown's user avatar
1 vote
2 answers
118 views

I would like to change the title of the plot and the labels on the x and y axes without modifying the variable names in the dataframe. I am using the gratia package. library(patchwork) library(gratia) ...
F3d33's user avatar
  • 13
0 votes
1 answer
123 views

I'm using R to model the tone contour (pitch) of words in a language and I have two main questions. Note that I am new to R and don't have a data science background, so any help is really appreciated. ...
SanguineEpitaph's user avatar
1 vote
1 answer
73 views

I am running the model below (modGI_test): modGI_test <- gam(Met1 ~ Antibiotics + s(Timepoint, k=7) + s(Timepoint, by=Antibiotics, k=7, m=1) + s(Timepoint, ID_new,...
pemb_bex6789's user avatar
0 votes
1 answer
58 views

I have a code that works if I am using LM but not if I am using a GAM. I guess the that for whatever reason LM looks inside object for the variable and GAM just looks at the names of the object but I ...
adrianmnc's user avatar
1 vote
1 answer
196 views

I try to fit a GAM model with a multidimensional categorical response variable combining three binomial dimensions (e.g., A-B by a-b by α-β) lacking certain combinations and depending on a smooth of ...
David's user avatar
  • 107
0 votes
0 answers
37 views

I am currently building several similar GAMM models on numerous datasets with the same structure but varying sizes, with the smaller datasets containing about 15k rows and the largest around 400k. I’...
Jul2415's user avatar
0 votes
1 answer
221 views

I am using the mgcv package to train a gam model (family = betar(), method = 'REML' using 10 threads). I use the tp basis. I split my dataset in multiple train-test splits - my main interest is ...
TheRajVJain's user avatar
2 votes
0 answers
54 views

I'm working with the gam function from the mgcv package in R, and I have a custom function that uses a weights vector to fit the model. My issue is that when I pass a weights vector to the function as ...
Paco Herrera's user avatar
1 vote
0 answers
125 views

I am fitting this model: m <- bam(f, data = d, family = binomial(link = 'logit'), select = TRUE, method = 'REML') where f is y ~ s(t) + s(x1) + s(x2) + s(x3) + ...
beng5000's user avatar
1 vote
1 answer
43 views

I am fitting a typical GAM with lagged structure. The gam has the general form: g1<-gam(y~te(e, l), data=df) Specifically: #exposure e <- matrix(rnorm(2500, mean = 100, sd = 25), ncol=50) #lag ...
monviso's user avatar
  • 51
2 votes
1 answer
206 views

I use the mgcv package on R, and I have a model like this : gamm_model <- gam(Y ~ s(X, bs = "ps") + B + C + s(D, bs = 're') + s(E, bs = 're'), data = df) summary(gamm_model) I would ...
Jeremy's user avatar
  • 55
3 votes
1 answer
161 views

I am trying to model temperature across seasons using (package mgcv) GAMs. I am interested in using terra::predict() to plot the predicted temperatures as a raster. Ideally, the output would be 4 ...
R Reid's user avatar
  • 31
2 votes
1 answer
75 views

I am using MGCV to generate predictions for a GAM using a cubic spline forced through a certain point. I have generated the gam exactly as outlined in this post: https://stat.ethz.ch/pipermail/r-help/...
Gretel's user avatar
  • 23
2 votes
1 answer
86 views

I have two types of models (GAM and beta regression) that I am running for my data and I am using a lapply function to iterate over multiple variables. I am encountering an error when trying to export ...
DaniH's user avatar
  • 75
0 votes
1 answer
387 views

I have a presence/absence data for a species occurrence and I did a binomial GAM using sea surface temperature (sst) as a predictor variable. My df object is a data.frame with the presence/absence ...
Maria Inês Silva's user avatar
1 vote
1 answer
77 views

In R version 3.6.3, my predict.gam function gives a result. When I use R 4.x, I get errors for some types of predict, but not others. My goal is to be able to use this code in R4. library(gam) gm1 <...
we need a Mat. Stat.'s user avatar
0 votes
0 answers
121 views

Consider the multinomial GAM with mgcv in R library(mgcv) multinom = gam(list(sound ~ word + s(long, lat), ~ word + s(long, lat), ~ word + s(long, ...
David's user avatar
  • 107
0 votes
0 answers
100 views

How can I improve my bam model if 3/4 gam.check plots show poor diagnosis, except for the histogram of residuals (which shows a normal distribution). My response variable is soundscape saturation (...
Carla Mere's user avatar
0 votes
1 answer
402 views

I have a data set with 40 sites (long, lat) by 2 ages by 2 genders by 6 words and 6 dependent sound categories (coded 0 to 5) as simulated here: sound <- sample(0:5, size=960, replace=T) ...
David's user avatar
  • 107
1 vote
0 answers
64 views

In R version 3.6.3, my predict.gam function gives a result. When I use R 4.x, I get errors for some types of predict, but not others: library(gam) library(dplyr) gm1 <- predCol ~ s(VCF_nontree) + ...
we need a Mat. Stat.'s user avatar
1 vote
1 answer
192 views

I am currently working on fitting splines with gamm4 and I have hierarchical data. In my dataset, Trial_no is nested within VP, and SoundType (levels: STA and DEV) is a level-1 predictor. My model ...
user25610677's user avatar
1 vote
1 answer
145 views

I am attempting to model species' responses to an environmental gradient to characterise their niche in terms of this gradient. I will be using a data on presence/absence of species in grids along ...
Will's user avatar
  • 33
1 vote
1 answer
205 views

Here is a little script describing my problem. I am fitting a logistic model in R using the mgcv package. The dataset represent the occurrence of an event under certain conditions. For this model, I ...
Arnaud's user avatar
  • 387
1 vote
2 answers
236 views

I have several large GAM models to fit (lots of data, various distributions for residuals and random effect smooths). Currently, I use foreach with a cluster of processors based on the parallel ...
David M. Kaplan's user avatar
0 votes
0 answers
183 views

I’m working with a dataset that has missing values, and I am using multiple imputation with the mice package in R. I then fit a Generalized Additive Model (GAM) using the mgcv package on the imputed ...
Katherine Drummond's user avatar
1 vote
1 answer
76 views

I am using the wonderful gratia package to visualize multiple gam models from the mgcv package using the compare_smooths function. While I am able to create the gams properly and draw them, I cannot ...
flâneur's user avatar
  • 331
2 votes
1 answer
303 views

I created a GAM model using mgcv. My response variable is log transformed. I would like to plot this model using gratia. However, I want to make sure the y-axis is exponentiated after I plot it using ...
Eazye's user avatar
  • 21
1 vote
1 answer
152 views

How do you extract the pooled estimated degrees of freedom (edf) from a pooled generalized additive model ? library(mice) # For multiple imputation library(mgcv) # For GAM models library(broom) # ...
Katherine Drummond's user avatar
0 votes
2 answers
247 views

I am trying to predict the occurrence of a species (presence/absence) using a GAM in R. I have fit the GAM, but I get an error when I try to make the prediction to spatial data with terra::predict(). ...
seak23's user avatar
  • 327
0 votes
1 answer
26 views

I have created this regression model that works well : model1 = bam(depend ~ s(indep, by = gender.x,bs = "tp") + s(Age, by = gender.x, bs = "tp") + ti(Age, indep, by = gender....
Ruben MIRANDA MARCOS's user avatar
0 votes
1 answer
644 views

I'm encountering an issue fitting a model with zero-inflated data. You can view the distribution of the response variable here: The random effect is linked with the variable "site". The ...
Pierre Marle's user avatar
1 vote
1 answer
201 views

This is my first post so I am sorry if I did something wrong (hope not!). I am struggling with aesthetics of my GAM plots, tried different options, searched for solutions but did not succeeded. I am ...
Online Browser's user avatar
0 votes
0 answers
74 views

Am performing mgcv::gam over each unique XY pairing (2 in this instance) and both of these pairings have just 11 obs. Ideally, the prediction of A=0 should be somewhere between B = 2,000 and 1,000. ...
user11057680's user avatar
1 vote
1 answer
102 views

I have blood biochemistry markers measured in 28 subjects, where samples were collected every month. I can run a simple modG with gamm and get the acf and pacf plots. modG <- gamm(Met1 ~ s(...
Adam9's user avatar
  • 55
1 vote
1 answer
7k views

I am trying to draw GAMs in R using the below code. This code always used to work, and I could draw the partial effect of my smoothed term, but randomly it no longer works, consistently triggering ...
flâneur's user avatar
  • 331

1
2 3 4 5
15