Displaying 20 results from an estimated 4000 matches similar to: "gamm() and predict()"
2006 Dec 04
1
package mgcv, command gamm
Hi
I am an engineer and am running the package mgcv and specifically the
command gamm (generalized additive mixed modelling), with random
effects. i have a few queries:
1. When I run the command with 1000/2000 observations, it runs ok.
However, I would like to see the results as in vis.gam command in the
same package, with the 3-d visuals. It appears no such option is
available for gamm in the
2006 Jul 03
1
gamm
Hello,
I am a bit confused about gamm in mgcv. Consulting Wood (2006) or Ruppert et al. (2003) hasn't taken away my confusion.
In this code from the gamm help file:
b2<-gamm(y~s(x0)+s(x1)+s(x2)+s(x3),family=poisson,random=list(fac=~1))
Am I correct in assuming that we have a random intercept here....but that the amount of smoothing is also changing per level of the
2012 Apr 02
1
gamm: tensor product and interaction
Hi list,
I'm working with gamm models of this sort, using Simon Wood's mgcv library:
gm<- gamm(Z~te(x,y),data=DATA,random=list(Group=~1))
gm1<-gamm(Z~te(x,y,by=Factor)+Factor,data=DATA,random=list(Group=~1))
with a dataset of about 70000 rows and 110 levels for Group
in order to test whether tensor product smooths vary across factor levels. I was wondering if comparing those two
2012 Jun 11
0
gamm (mgcv) interaction with linear term
Hello,
I am trying to fit a gamm (package mgcv) model with a smooth term, a linear term, and an interaction between the two. The reason I am using gamm rather than gam is that there are repeated measures in time (which is the smooth term x1), so I am including an AR1 autocorrelation term. The model I have so far ended up with is of the type
gamm(y ~ s(x1) + s(x1, by=x2), correlation =
2009 May 27
1
Deviance explined in GAMM, library mgcv
Dear R-users,
To obtain the percentage of deviance explained when fitting a gam model using the mgcv library is straightforward:
summary(object.gam) $dev.expl
or alternatively, using the deviance (deviance(object.gam)) of the null and the fitted models, and then using 1 minus the quotient of deviances.
However, when a gamm (generalizad aditive mixed model) is fitted, the
2011 Sep 22
1
negative binomial GAMM with variance structures
Hello,
I am having some difficulty converting my gam code to a correct gamm code, and I'm really hoping someone will be able to help me.
I was previously using this script for my overdispersed gam data:
M30 <-gam(efuscus~s(mic, k=7) +temp +s(date)+s(For3k, k=7) + pressure+ humidity, family=negbin(c(1,10)), data=efuscus)
My gam.check gave me the attached result. In order to
2011 Jun 24
2
mgcv:gamm: predict to reflect random s() effects?
Dear useRs,
I am using the gamm function in the mgcv package to model a smooth relationship between a covariate and my dependent variable, while allowing for quantification of the subjectwise variability in the smooths. What I would like to do is to make subjectwise predictions for plotting purposes which account for the random smooth components of the fit.
An example. (sessionInfo() is at
2012 Dec 07
1
Negative Binomial GAMM - theta values and convergence
Hi there,
My question is about the 'theta' parameter in specification of a NB GAMM.
I have fit a GAM with an optimum structure of:
SB.gam4<-gam(count~offset(vol_offset)+
s(Depth_m, by=StnF, bs="cs")+StageF*RegionF,
family=negbin(1, link=log),
data=Zoop_2011[Zoop_2011$SpeciesF=='SB',])
However, this GAM shows heterogeneity in the
2011 Mar 17
2
fitting gamm with interaction term
Hi all,
I would like to fit a gamm model of the form:
Y~X+X*f(z)
Where f is the smooth function and
With random effects on X and on the intercept.
So, I try to write it like this:
gam.lme<- gamm(Y~ s(z, by=X) +X, random=list(groups=pdDiag(~1+X)) )
but I get the error message :
Error in MEestimate(lmeSt, grps) :
Singularity in backsolve at level 0, block 1
2009 Jul 08
1
Comparing GAMMs
Greetings!
I am looking for advice regarding the best way to compare GAMMs. I
know other model outputs return enough information for R's AIC, ANOVA,
etc. commands to function, but this is not the case with GAMM unless one
specifies the gam or lme portion. I know these parts of the gamm contain
items that will facilitate comparisons between gamms. Is it correct to
simply use these values
2005 Apr 13
0
GAMM in mgcv - significance of smooth terms
In the summary of the gam object produced by gamm, the "Approximate
significance of smooth terms" appears to be a test of the improvement in fit
over a linear model, rather than a test of the significance of the overall
effect of x on y:
test.gamm<-gamm(y~te(x, bs="cr"), random=list(grp=~1))
summary(test.gamm$gam)
.
.
.
Approximate significance of smooth terms:
2009 May 18
1
Predicting complicated GAMMs on response scale
Hi,
I am using GAMMs to show a relationship of temperature differential over
time with a model that looks like this:-
gamm(Diff~s(DaysPT)+AirToC,method="REML")
where DaysPT is time in days since injury and Diff is repeat measures of
temperature differentials with regards to injury sites compared to
non-injured sites in individuals over the course of 0-24 days. I use the
following
2012 May 03
1
conducting GAM-GEE within gamm4?
Dear R-help users,
I am trying to analyze some visual transect data of organisms to generate a
habitat distribution model. Once organisms are sighted, they are followed
as point data is collected at a given time interval. Because of the
autocorrelation among these "follows," I wish to utilize a GAM-GEE approach
similar to that of Pirotta et al. 2011, using packages 'yags' and
2012 Feb 22
1
Gamm and post comparison
My data set consist of number of calls (lcin) across Day. I am looking for
activity differences between three features (4 sites per feature). I am also
looking for peaks of activity across time (Day). I am using a gamm since I
believe these are nonlinear trends with nested data.
gammdata<-gamm(lcin~Temp+s(Day)+fType+wind+fFeature+Forest+Water+Built,
list=fSite,data=data, family=gaussian)
2009 Nov 21
1
3-D Plotting of predictions from GAM/GAMM object
Hello all,
Thank you for the previous assistance I received from this listserve!
My current question is: How can I create an appropriate matrix of
values from a GAM (actually a GAMM) to make a 3-D plot? This model is
fit as a tensor product spline of two predictors and I have used it to
make specific predictions by calling:
2016 Apr 11
0
Intro GAM and GAMM course: Singapore
There are 4 remaining seats on the following statistics course:
Course: Introduction to GAM and GAMM with R
When: 30 May-3 June 2016
Where: Tropical Marine Science Institute, National University of
Singapore, Singapore
Course website: http://highstat.com/statscourse.htm
Course flyer: http://highstat.com/Courses/Flyers/Flyer2016_05Singapore.pdf
--
Dr. Alain F. Zuur
First author of:
1.
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:
2006 Jun 06
1
gamm error message
Hello,
Why would I get an error message with the following code for gamm? I
want to fit the a gam with different variances per stratum.
library(mgcv)
library(nlme)
Y<-rnorm(100)
X<-rnorm(100,sd=2)
Z<-rep(c(T,F),each=50)
test<-gamm(Y~s(X),weights=varIdent(form=~1|Z))
summary(test$lme) #ok
summary(test$gam)
Gives an error message:
Error in inherits(x, "data.frame")
2010 May 13
1
GAM, GAMM and numerical integration, help please
I am trying to apply methods used by Chaloupka & Limpus (1997) (
http://www.int-res.com/articles/meps/146/m146p001.pdf) to my own turtle
growth data.
I am having trouble with two things...
1) After the GAM is fit, the residuals are skewed.
>m1 <- gam(growth~s(mean.size,
bs="cr")+s(year,bs="cr",k=7)+s(cohort,bs="cr")+s(age,bs="cr"),
data=grow,
2006 Oct 16
1
linear mixed effects models with breakpoints
Hi folks
I have some data to which I've been fitting linear mixed effects
models. I am currently using a lme model in the nlme package, with terms
for random effects due to repeated measures on individuals and the
corCAR1 serial correlation structure. However, there is some suggestion
in the data (and from theory) that a breakpoint (change point) model may
be more appropriate. Scott, Norman