Displaying 20 results from an estimated 10000 matches similar to: "How to compare GLM and GAM models"
2007 Oct 03
1
How to avoid overfitting in gam(mgcv)
Dear listers,
I'm using gam(from mgcv) for semi-parametric regression on small and
noisy datasets(10 to 200
observations), and facing a problem of overfitting.
According to the book(Simon N. Wood / Generalized Additive Models: An
Introduction with R), it is
suggested to avoid overfitting by inflating the effective degrees of
freedom in GCV evaluation with
increased "gamma"
2009 Sep 11
0
How to compare the result of GLM and GAM
Dear R users
I have basic knowledge of R and unaware of many more.
I am confused about how can I compare the result of two different models?
Have count data of plant species and want to correlate with altitude, rri,
pH, moisture, temperature etc. I have made some models using GLM of
different orders and I found 2nd order GLM significant than others. Now, I
wanted to check whether GAM is more
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
2011 Jan 18
1
Circular variables within a GLM, GLM-GEE or GAM
Hi,
I have a variable (current speed direction) which is circular (0=360 degrees), and I'd like my GLM to include the variable as a circular variable. Can I do this? And what is the code?
I'm actually doing a GLM-GEE using the 'geepack' package, so want to use it in that, but also interested in whether it can also be used in GLMs and GAMs (I use the 'mgcv' package for
2009 Jun 18
3
predict.glm and predict.gam output
Hi all,
I am currently trying to compare different plant occurrence prediction
maps generated in R and exported into GRASS. One of these maps was
generated from a glm fitted to some data, and subsequently applying this
glm model to a wider region using predict.glm. The outcome here was a
probability of occurrence. The second map I generated using a gam
(mgcv), however, this map seems to have
2007 Jun 15
1
interpretation of F-statistics in GAMs
dear listers,
I use gam (from mgcv) for evaluation of shape and strength of relationships
between a response variable and several predictors.
How can I interpret the 'F' values viven in the GAM summary? Is it
appropriate to treat them in a similar manner as the T-statistics in a
linear model, i.e. larger values mean that this variable has a stronger
impact than a variable with smaller F?
2004 Oct 26
3
GLM model vs. GAM model
I have a question about how to compare a GLM with a GAM model using anova
function.
A GLM is performed for example:
model1 <-glm(formula = exitus ~ age+gender+diabetes, family = "binomial",
na.action = na.exclude)
A second nested model could be:
model2 <-glm(formula = exitus ~ age+gender, family = "binomial", na.action =
na.exclude)
To compare these two GLM
2012 Jul 12
0
Enforcing inequality bounds and heteroscedasticity in a GAM or GLM
I have a spatial salinity field s and a model g(s) ~ Xb where the X comes from slightly modified GAM basis functions.
I am trying to deal with the following set of requirements:
1. The underlying physics are linear, and plain salinity (the identity link) is the correct response to my covariates.
2. Dispersion (variance or sd) is almost certainly proportional to the mean.
3. The data s(x,y)
2003 Feb 03
2
plot.gam for glm objects.
All,
I was wondering if someone had come across the problem of producing partial
regression plots for glm objects in R?
When using Splus in the past I have passed glm objects to the plot.gam
function.
To my knowledge this functionality isn't included in R ( I would be happily
corrected here) and if someone had some code floating around to do this it
would save me re-inventing wheels etc.
2008 Jan 08
3
GAM, GLM, Logit, infinite or missing values in 'x'
Hi,
I'm running gam (mgcv version 1.3-29) and glm (logit) (stats R 2.61) on
the same models/data, and I got error messages for the gam() model and
warnings for the glm() model.
R-help suggested that the glm() warning messages are due to the model
perfectly predicting binary output. Perhaps the model overfits the data? I
inspected my data and it was not immediately obvious to me (though I
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
2008 Aug 24
2
similarity between two gene lists with varied length
Dear listers,
a little off-topic:
I am looking for and compare algorithms which can calculate "distance" or
"similarity" between two gene lists with different lengths.
Any paper, any implementation in R and any suggestion is welcome!
Thanks,
--
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.
"Did you always know?"
"No, I did not. But I believed..."
2010 Aug 05
2
compare gam fits
Hi folks,
I originally tried R-SIG-Mixed-Models for this one
(https://stat.ethz.ch/pipermail/r-sig-mixed-models/2010q3/004170.html),
but I think that the final steps to a solution aren't mixed-model
specific, so I thought I'd ask my final questions here.
I used gamm4 to fit a generalized additive mixed model to data from a
AxBxC design, where A is a random effect (human participants in
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 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 Dec 23
1
Esttab error while exporting regression results
Dear listers,
I am trying to export a regression output to a latex document using the R
package eststo.
I have two variables:
an ordered factor:
group <- gl(3,5,20, labels=c("Ctl","Trt","prp"))
and a continuous variable:
weight <- runif(20)
I want to regress weight over group, therefore I run:
reg1 <- lm(weight ~ group)
I wish to include the output of my
2013 Jan 10
1
help with knit_hooks
Dear R-listers,
does anybody can suggest some manual where I can learn more about how the
hooks in knitr work?
I am trying to enclose the output of an R command in the Latex verbatim
environment.
I defined a hook as follows:
knit_hooks$set(fsverb = function(x, options) {
paste("\\begin(verbatim)\n", x, "\\end(verbatim)\n", sep = "")
}
then I set a chunk as
2012 Jan 25
6
How do I compare 47 GLM models with 1 to 5 interactions and unique combinations?
Hi R-listers,
I have developed 47 GLM models with different combinations of interactions
from 1 variable to 5 variables. I have manually made each model separately
and put them into individual tables (organized by the number of variables)
showing the AIC score. I want to compare all of these models.
1) What is the best way to compare various models with unique combinations
and different number
2008 Aug 19
0
gam.check in gam (mgcv)
Hallo
I need some help with the output provided by gam.check after a gam fit (using the package mgcv).
To give a brief description of my data, I have
claims: a vector of values, which include NA's and one large negative value - otherwise all positive (55 values in total that are not NA).
origin: a factor with 10 levels
j : taking the values 1, 2, ...., 10
I have fitted a gam, with:
>
2007 Jun 22
1
two basic question regarding model selection in GAM
Qusetion #1
*********
Model selection in GAM can be done by using:
1. step.gam {gam} : A directional stepwise search
2. gam {mgcv} : Smoothness estimation using GCV or UBRE/AIC criterion
Suppose my model starts with a additive model (linear part + spline part).
Using gam() {mgcv} i got estimated degrees of freedom(edf) for the smoothing
splines. Now I want to use the functional form of my model