Displaying 20 results from an estimated 8000 matches similar to: "variance explained by each term in a GAM"
2011 Mar 11
0
variance explained by each term in a GAM
Picking up an ancient thread (from Oct 2007), I have a somewhat more complex 
problem than given in Simon Wood's example below. My full model has more than 
two smooths as well as factor variables as in this simplified example:
b <- gam(y~fv1+s(x1)+s(x2)+s(x3))
Judging from Simon's example, my guess is to fit reduced models to get 
components of deviance as follows:
b1 <-
2011 Nov 10
1
Sum of the deviance explained by each term in a gam model does not equal to the deviance explained by the full model.
Dear R users,
    I read your methods of extracting the variance explained by each
predictor in different places. My question is: using the method you
suggested, the sum of the deviance explained by all terms is not equal to
the deviance explained by the full model. Could you tell me what caused
such problem?
>  set.seed(0)
>  n<-400
>  x1 <- runif(n, 0, 1)
>  ## to see problem
2009 Jul 12
1
variance explained by each predictor in GAM
Hi,
I am using mgcv:gam and have developed a model with 5 smoothed predictors
and one factor.
gam1 <- gam(log.sp~ s(Spr.precip,bs="ts")  + s(Win.precip,bs="ts") + s(
Spr.Tmin,bs="ts")  + s(P.sum.Tmin,bs="ts") + s( Win.Tmax,bs="ts")
+factor(site),data=dat3)
The total deviance explained = 70.4%.
I would like to extract the variance explained
2008 May 06
1
mgcv::gam shrinkage of smooths
In Dr. Wood's book on GAM, he suggests in section 4.1.6 that it might be
useful to shrink a single smooth by adding S=S+epsilon*I to the penalty
matrix S. The context was the need to be able to shrink the term to zero if
appropriate. I'd like to do this in order to shrink the coefficients towards
zero (irrespective of the penalty for "wiggliness") - but not necessarily
all the
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
2006 Jan 19
2
gam
Dear R users,
I'm new to both R and to this list and would like to get 
advice on how to build generalized additive models in R. 
Based on the description of gam, which I found on the R 
website, I specified the following model:
model1<-gam(ST~s(MOWST1),family=binomial,data=strikes.S),
in which ST is my binary response variable and MOWST1 is a 
categorical independent variable.
I get the
2007 Aug 14
1
weights in GAMs (package mgcv)
Dear list,
I?m using the ?mgcv? package to fit some GAMs. Some of my covariates are 
derived quantities and have an associated standard error, so I would 
like to incorporate this uncertainty into the GAM estimation process. 
Ideally, during the estimation process less importance would be given to 
observations whose covariates have high standard errors.
The gam() function in the ?mgcv? package
2009 Mar 04
1
help with GAM
Hi
I'm trying to do a GAM analysis and have the following codes entered
into R (density is = sample number, alive are the successes)
density<-as.real(density)
y<-cbind(alive,density-alive)
library(mgcv)
m1<-gam(y~s(density),binomial)
at which point I get the following error message
Error in smooth.construct.tp.smooth.spec(object, dk$data, dk$knots) :
A term has fewer unique
2010 Jan 26
1
AIC for comparing GLM(M) with (GAM(M)
Hello
I'm analyzing a dichotomous dependent variable (dv) with more than 100  
measurements (within-subjects variable: hours24) per subject and more  
than 100 subjects. The high number of measurements allows me to model  
more complex temporal trends.
I would like to compare different models using GLM, GLMM, GAM and  
GAMM, basically do demonstrate the added value of GAMs/GAMMs relative  
to
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
2010 Feb 15
1
GAM for non-integer proportions
Dear list,
I´m using the mgcv package to model the proportion by weight of certain prey
on the stomach content of a predator.  This proportion is the ratio of two
weights (prey weight over stomach weight), and ranges between 0 and 1.  The
variance is low when proportion is close to 0 and 1, and higher at
intermediate values.
It seems that the best way to go is to model this using the
2002 Nov 13
2
Comparing GAM objects using ANOVA
Hi,
Is it possible to compare two GAM objects created with the gam() function from the mgcv package. I use a slightly modified version of anova.glm() named anova.gam(), modified from John Fox (2002). It often gives me some aberant responses, especially with "F" test. I use a quasibinomial model and scale (dispersion) is calculated and used in the calculation of the F value. Does someone
2005 Sep 26
4
p-level in packages mgcv and gam
Hi,
I am fairly new to GAM and started using package mgcv. I like the  
fact that optimal smoothing is automatically used (i.e. df are not  
determined a priori but calculated by the gam procedure).
But the mgcv manual warns that p-level for the smooth can be  
underestimated when df are estimated by the model. Most of the time  
my p-levels are so small that even doubling them would not result
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)
2013 Mar 26
2
GAM model with interactions between continuous variables and factors
Hi all,
I am not sure how to handle interactions with categorical predictors in the
GAM models. For example what is the different between these bellow two
models. Tests are indicating that they are different but their predictions
are essentially the same.
Thanks a bunch,
> gam.1 <- gam(mortality.under.2~ maternal_age_c+ I(maternal_age_c^2)+
+                s(birth_year,by=wealth) +
+    
2011 Jun 16
0
proportion explained by each term in a GAM
Dear list,
I have read several posts on this topic. I would use the same
methodology as proposed
by Simon Wood in this post:
http://r.789695.n4.nabble.com/variance-explained-by-each-term-in-a-GAM-td836513.html
My first question is:
Does anyone know a scientific source (paper, book,...) that explains
or uses this
methodology. I have read several articles, particularly in the field of
ecology,
2009 Apr 28
2
Why there is no p-value from likelihood ratio test using anova in GAM model fitting?
Hello, everybody,
There is the first time for me to post a question, because I really cannot
find answer from books, websites or my colleagues. Thank you in advance for
your help!
I am running likelihood ratio test to find if the simpler model is not
significant from more complicated model. However, when I run LRT to compare
them, the test did not return F value and p-value for me. What's the
2011 Apr 12
1
Model checking for gam (mgcv) result
Dear list,
i'm checking the residuals plots of a gam model after a processus of model
selection. I found the "best" model, all my terms are significant, the
r-square and the deviance explained are good, but I have strange residuals
plots:
http://dl.dropbox.com/u/1169100/gam.check.png
http://dl.dropbox.com/u/1169100/residuals_vs_fitted.png
What does explains the "curve"
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
2013 Dec 16
1
log transforming predictor variables in a binomial GAM?
Hi all,
I am applying a Presence/absence Generalized additive model to model the distribution of marine algae species in R. I have found that log transforming the environmental variables improves the explained deviance of the model considerably. While log transforming is common practice in GLM, I have been unable to find any papers where this is performed in a GAM. Im wondering whether this