similar to: About GAM in R, Need YOUR HELP!

Displaying 20 results from an estimated 10000 matches similar to: "About GAM in R, Need YOUR HELP!"

2011 Sep 28
2
GAMs in R : How to put the new data into the model?
I have 5 GAMs ( model1, model2, model3, model4 and model5) Before I use some data X(predictor -January to June data) to form a equation and calculate the expected value of Y (predictand -January to June). After variable selection, GAMs (Model 1)were bulit up! R-square :0.40 NOW, I want to use new X'( predictor -July - December data) and put into Model 1, then get the expected value of Y'
2011 Oct 13
3
Question about GAMs
hi! I hope all of you can help me this question for example GAMs: ozonea<-gam(newozone~ pressure+maxtemp+s(avetemp,bs="cr")+s(ratio,bs="cr"),family=gaussian (link=log),groupA,methods=REML) formula(ozonea) newozone ~ pressure + maxtemp + s(avetemp, bs = "cr") + s(ratio,bs = "cr") #formula of gams coef(ozonea) # extract the coefficient of GAMs
2011 Jun 19
2
please help! what are the different using log-link function and log transformation?
I'm new R-programming user, I need to use gam function. y<-gam(a~s(b),family=gaussian(link=log),data) y<-gam(loga~s(b), family =gaussian (link=identity),data) why these two command results are different? I guess these two command results are same, but actally these two command results are different, Why? -- View this message in context:
2011 Oct 04
2
About stepwise regression problem
First of all, I have GAMs noxd<-gam(newNOX~pressure+maxtemp+s(avetemp,bs="cr")+s(mintemp,bs="cr")+s(RH,bs="cr")+s(solar,bs="cr")+s(windspeed,bs="cr")+s(transport,bs="cr"),family=gaussian (link=log),groupD,methods=REML) Then I type " summary(noxd)". and show Family: gaussian Link function: log Formula: newNO2 ~ pressure
2010 Mar 04
2
which coefficients for a gam(mgcv) model equation?
Dear users, I am trying to show the equation (including coefficients from the model estimates) for a gam model but do not understand how to. Slide 7 from one of the authors presentations (gam-theory.pdf URL: http://people.bath.ac.uk/sw283/mgcv/) shows a general equation log{E(yi )} = ?+ ?xi + f (zi ) . What I would like to do is put my model coefficients and present the equation used. I am an
2005 Oct 05
3
testing non-linear component in mgcv:gam
Hi, I need further help with my GAMs. Most models I test are very obviously non-linear. Yet, to be on the safe side, I report the significance of the smooth (default output of mgcv's summary.gam) and confirm it deviates significantly from linearity. I do the latter by fitting a second model where the same predictor is entered without the s(), and then use anova.gam to compare the
2005 Oct 24
2
GAM and AIC: How can I do??? please
Hello, I'm a Korean researcher who have been started to learn the "R" package. I want to make gam model and AIC value of the model to compare several models. I did the GAM model, but there were error for AIC. SO, how can I do? pleas help me!!! I did like below; > a.fit <- gam(pi~ s(t1r), family = gaussian(link="log")) >
2020 Apr 28
2
mclapply returns NULLs on MacOS when running GAM
Dear R-devel, I am experiencing issues with running GAM models using mclapply, it fails to return any values if the data input becomes large. For example here the code runs fine with a df of 100 rows, but fails at 1000. library(mgcv) library(parallel) > df <- data.frame( + x = 1:100, + y = 1:100 + ) > > mclapply(1:2, function(i, df) { + fit <- gam(y ~ s(x, bs =
2011 May 05
1
Using $ accessor in GAM formula
This is not mission critical, but it's bothering me. I'm getting inconsistent results when I use the $ accessor in the gam formula *In window #1:* > library(mgcv) > dat=data.frame(x=1:100,y=sin(1:100/50)+rnorm(100,0,.05)) > str(dat) > gam(dat$y~s(dat$x)) Error in eval(expr, envir, enclos) : object 'x' not found > *In window #2:* > gm = gam(dat$cf~s(dat$s)) >
2007 Oct 17
1
Error message in GAM
Hello useRs! I have % cover data for different plant species in 300 plots, and I use the ARCSINE transformation (to deal with % cover data). When I use a GLM I do not have any problem. But when I am trying to use a GAM model using mgcv package, to account for non-linearity I get an ?error message?. I use the following model: sp1.gam<-gam(asin(sqrt(0.01*SP1COVER))~
2011 Nov 08
3
GAM
Hi R community! I am analyzing the data set "motorins" in the package "faraway" by using the generalized additive model. it shows the following error. Can some one suggest me the right way? library(faraway) data(motorins) motori <- motorins[motorins$Zone==1,] library(mgcv) >amgam <- gam(log(Payment) ~ offset(log(Insured))+ s(as.numeric(Kilometres)) + s(Bonus) + Make +
2013 Jul 08
1
error in "predict.gam" used with "bam"
Hello everyone. I am doing a logistic gam (package mgcv) on a pretty large dataframe (130.000 cases with 100 variables). Because of that, the gam is fitted on a random subset of 10000. Now when I want to predict the values for the rest of the data, I get the following error: > gam.basis_alleakti.1.pr=predict(gam.basis_alleakti.1, +
2012 May 29
1
GAM interactions, by example
Dear all, I'm using the mgcv library by Simon Wood to fit gam models with interactions and I have been reading (and running) the "factor 'by' variable example" given on the gam.models help page (see below, output from the two first models b, and b1). The example explains that both b and b1 fits are similar: "note that the preceding fit (here b) is the same as
2008 Jun 11
1
mgcv::gam error message for predict.gam
Sometimes, for specific models, I get this error from predict.gam in library mgcv: Error in complete.cases(object) : negative length vectors are not allowed Here's an example: model.calibrate <- gam(meansalesw ~ s(tscore,bs="cs",k=4), data=toplot, weights=weight, gam.method="perf.magic") > test <- predict(model.calibrate,newdata) Error in
2012 Aug 22
2
AIC for GAM models
Dear all, I am analysing growth data - response variable - using GAM and GAMM models, and 4 covariates: mean size, mean capture year, growth interval, having tumors vs. not The models work fine, and fit the data well, however when I try to compare models using AIC I cannot get an AIC value. This is the code for the gam model:
2004 Dec 06
1
Gam() function in R
Unfortunately that's not really an R question. I recommend that you read up on the statistical methods underneath. One that I'd wholeheartedly recommend is Prof. Harrell's `Regression Modeling Strategies'. [BTW, there are now two implementations of gam() in R: one in `mgcv', which is fairly different from that in `gam'. I'm guessing you're referring to the one
2020 Apr 28
2
mclapply returns NULLs on MacOS when running GAM
Yes I am running on Rstudio 1.2.5033. I was also running this code without error on Ubuntu in Rstudio. Checking again on the terminal and it does indeed work fine even with large data.frames. Any idea as to what interaction between Rstudio and mclapply causes this? Thanks, Shian On 28 Apr 2020, at 7:29 pm, Simon Urbanek <simon.urbanek at R-project.org<mailto:simon.urbanek at
2017 Dec 14
1
GAM Poisson
Dear all, I apologize as this may not be a strictly R question. I am running GAM models using the mgcv package. I was wondering if the interpretation of the smooth splines of the 'x' variable is the same in the following two cases: # Linear probability model m1 <- gam(count ~ factor(city) + factor(year) + s(x), data=data,na.action=na.omit) # Poisson m2 <- gam(count ~ factor(city)
2012 Jan 13
1
deviance and variance - GAM models
Hi all, This is pretty basic but I am not an expert and I couldn't find anything in the forum or my statistics book about it. I was reading a paper and the authors were using both "explained deviance" and "explained variance" as synonyms. They were describing a GAM regression. Is that right? I performed an analysis in R to take a look to the output of GAM regression and I
2012 Jan 16
1
GAM without intercept reports a huge deviance
Hi all, I constructed a GAM model with a linear term and two smooth terms, all of them statistically significant but the intercept was not significant. The adjusted r2 of this model is 0.572 and the deviance 65.3. I decided to run the model again without intercept, so I used in R the following instruction: regression= gam(dependent~ +linear_independent +s(smooth_independent_1)