Displaying 20 results from an estimated 4000 matches similar to: "variance explained by each term in a GAM"
2007 Oct 08
2
variance explained by each term in a GAM
Hello fellow R's,
I do apologize if this is a basic question. I'm doing some GAMs using the mgcv package, and I am wondering what is the most appropriate way to determine how much of the variability in the dependent variable is explained by each term in the model. The information provided by summary.gam() relates to the significance of each term (F, p-value) and to the
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
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,
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
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
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
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
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
2010 May 17
0
GAM vs. GAMM, how to model increasing error variance?
I fit a GAM to turtle growth data using mgcv:
>m1 <- gam(growth~s(mean.size,
bs="cr")+s(year,bs="cr",k=7)+s(cohort,bs="cr")+s(age,bs="cr"), data=grow,
family=quasi(link="identity"))
The errors are skewed (and seem to be correlated with age) (code and plots
here:
2007 Jun 21
1
mgcv: lowest estimated degrees of freedom
Dear list,
I do apologize if these are basic questions. I am fitting some GAM
models using the mgcv package and following the model selection criteria
proposed by Wood and Augustin (2002, Ecol. Model. 157, p. 157-177). One
criterion to decide if a term should be dropped from a model is if the
estimated degrees of freedom (EDF) for the term are close to their lower
limit.
What would be the
2011 Jan 26
0
post-hoc comparisons in GAMs (mgcv) with parametric terms
Dear list,
I?m wondering if there is something analogous to the TukeyHSD function
that could be used for parametric terms in a GAM. I?m using the mgcv
package to fit models that have some continuous predictors (modeled as
smooth terms) and a single categorical predictor. I would like to do
post hoc test on the categorical predictor in the models where it is
significant.
Any suggestions?
2009 Feb 25
1
monotonic GAM with more than one term
Hi,
Does anyone know how to fit a GAM where one or more smooth terms are
constrained to be monotonic, in the presence of "by" variables or
other terms? I looked at the example in ?pcls but so far have not been
able to adapt it to the case where there is more than one predictor.
For example,
require(mgcv)
set.seed(0)
n<-100
# Generate data from a monotonic truth.
2013 Apr 16
2
Understanding why a GAM can't have an intercept
Dear List,
I've just tried to specify a GAM without an intercept -- I've got one of
the (rare) cases where it is appropriate for E(y) -> 0 as X ->0.
Naively running a GAM with the "-1" appended to the formula and the
calling "predict.gam", I see that the model isn't behaving as expected.
I don't understand why this would be. Google turns up this old
2011 Mar 07
0
Conflict between gam::gam and mgcv::gam
I am trying to compare and contrast the smoothing in the {mgcv} version
of gam vs. the {gam} version of gam but I get a strange side effects
when I try to alternate calls to these routines, even though I detach
and unload namespaces.
Specifically when I start up R the following code runs successfully
until the last line i.e. plot(g4,se=TRUE) when I get "Error in
dim(data) <- dim :
2008 Feb 28
0
use of step.gam (from package 'gam') and superassignment inside functions
Hello,
I am using the function step.gam() from the 'gam' package (header info
from library(help=gam) included below) and have come across some
behavior that I cannot understand. In short, I have written a function
that 1) creates a dataframe, 2) calls gam() to create a gam object, then
3) calls step.gam() to run stepwise selection on the output from gam().
When I do this, gam()
2005 Apr 18
0
Discrepancy between gam from gam package and gam in S-PLUS
Dear Trevor,
I've noticed a discrepancy in the degrees of freedom reported by gam() from
the gam package in R vs. gam() in S-PLUS. The nonparametric df differ by 1;
otherwise (except for things that depend upon the df), the output is the
same:
--------- snip ------------
*** From R (gam version 0.93):
> mod.gam <- gam(prestige ~ lo(income, span=.6), data=Prestige)
>
2009 Jun 23
1
Model fitting with GAM and "by" term
Hello R Users,
I have a question regarding fitting a model with GAM{mgcv}. I have data
from several predictor (X) variables I wish to use to develop a model to
predict one Y variable. I am working with ecological data, so have data
collected many times (about 20) over the course of two years. Plotting
data independently for each date there appears to be relationships
between Y (fish density)
2000 Jun 20
1
pacf
Dear list,
according to the documentation of acf{ts}
"the partial correlation coefficient is estimated by fitting
autoregressive models of successively higher orders up to lag.max. "
However, R seems to return the Yule-Walker estimates of the PACF by
default. You can check this using c(1:10) as the series: the YW
estimates are 0.7000000 and -0.1527035 for lags 1 and 2 . If the PACF
2005 Mar 24
1
Prediction using GAM
Recently I was using GAM and couldn't help noticing
the following incoherence in prediction:
> data(gam.data)
> data(gam.newdata)
> gam.object <- gam(y ~ s(x,6) + z, data=gam.data)
> predict(gam.object)[1]
1
0.8017407
>
predict(gam.object,data.frame(x=gam.data$x[1],z=gam.data$z[1]))
1
0.1668452
I would expect that using two types of predict
arguments
2009 Apr 28
0
problems in package gam
Hi all,
until now I have generally used mgcv for gams, however, I decided to
experiment with the package gam, and have ran into the previously
outlined problem (see below), for which I have not yet found a solution
in the archives. If anyone has any suggestions, please let me know.
The only difference for my case is that I am running R 2.9.0 under windows
Thank you!
I'm running R