Displaying 20 results from an estimated 10000 matches similar to: "gam for longitudinal data?"
2010 Aug 04
2
more questions on gam/gamm(mgcv)...
Hi R-users,
I'm using R 2.11.1, mgcv 1.6-2 to fit a generalized additive mixed model.
I'm new to this package...and just got more and more problems...
1. Can I include correlation and/or random effect into gam( ) also? or only
gamm( ) could be used?
2. I want to estimate the smoothing function s(x) under each level of
treatment. i.e. different s(x) in each level of treatment. shall I
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,
+
2010 Jun 16
3
mgcv, testing gamm vs lme, which degrees of freedom?
Dear all,
I am using the "mgcv" package by Simon Wood to estimate an additive mixed
model in which I assume normal distribution for the residuals. I would
like to test this model vs a standard parametric mixed model, such as the
ones which are possible to estimate with "lme".
Since the smoothing splines can be written as random effects, is it
correct to use an (approximate)
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
2010 Jun 18
2
varIdent error using gam function in mgcv
Hello,
As I am relatively new to the R environment this question may be either
a) Really simple to answer
b) Or I am overlooking something relatively simple.
I am trying to add a VarIdent structure to my gam model which is fitting
smoothing functions to the time variables year and month for a particular
species. When I try to add the varIdent weights to variable Month I get this
error returned.
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
2009 Jan 28
2
Repeated measures design for GAM? - corrected question...
Dear all,
I have a question on the use of GAM with repeated measures. My dataset is as follows:
- a number of study areas where bird abundance has been determined. Counts have been performed in 3 consecutive years and there were 2 counts per year (i.e. in total 6 counts).
- a number of environmental predictors that do not change over year Xi).
When using a GLM, a repeated measures design would
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
2013 Jun 07
1
gamm in mgcv random effect significance
Dear R-helpers,
I'd like to understand how to test the statistical significance of a
random effect in gamm. I am using gamm because I want to test a model
with an AR(1) error structure, and it is my understanding neither gam
nor gamm4 will do the latter.
The data set includes nine short interrupted time series (single case
designs in education, sometimes called N-of-1 trials in medicine)
2013 Mar 23
1
Time trends with GAM
Hi all,
I am using GAM to model time trends in a logistic regression. Yet I would
like to extract the the fitted spline from it to add it to another model,
that cannot be fitted in GAM or GAMM.
Thus I have 2 questions:
1) How can I fit a smoother over time so that I force one knot to be at a
particular location while letting the model to find the other knots?
2) how can I extract the matrix
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
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
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
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
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
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
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
2007 Dec 13
1
Two repeated warnings when runing gam(mgcv) to analyze my dataset?
Dear all,
I run the GAMs (generalized additive models) in gam(mgcv) using the
following codes.
m.gam
<-gam(mark~s(x)+s(y)+s(lstday2004)+s(ndvi2004)+s(slope)+s(elevation)+disbinary,family=binomial(logit),data=point)
And two repeated warnings appeared.
Warnings$B!'(B
1: In gam.fit(G, family = G$family, control = control, gamma = gamma, ... :
Algorithm did not converge
2: In gam.fit(G,
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
2009 Mar 24
2
help: what are the basis functions in {mgcv}: gam?
I am writing my thesis with the function gam(), with the package {mgcv}.
My command is: gam(y~s(x1,bs="cr")+s(x2, bs="cr")).
I need help to know what are the default basis funcitons for gam. I have not
found any detailed reference for this.
Can anyone help me with this??
--
View this message in context: