similar to: GAMM in mgcv - significance of smooth terms

Displaying 20 results from an estimated 2000 matches similar to: "GAMM in mgcv - significance of smooth terms"

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 =
2018 Apr 18
0
mgcv::gamm error when combining random smooths and correlation/autoregressive term
I am having difficulty fitting a mgcv::gamm model that includes both a random smooth term (i.e. 'fs' smooth) and autoregressive errors. Standard smooth terms with a factor interaction using the 'by=' option work fine. Both on my actual data and a toy example (below) I am getting the same error so am inclined to wonder if this is either a bug or a model that gamm is simply unable
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)
2013 Mar 15
0
Poisson and negbin gamm in mgcv - overdispersion and theta
Dear R users, I am trying to use "gamm" from package "mgcv" to model results from a mesocosm experiment. My model is of type M1 <- gamm(Resp ~ s(Day, k=8) + s(Day, by=C, k=8) + Flow + offset(LogVol), data=MyResp, correlation = corAR1(form= ~ Day|Mesocosm), family=poisson(link=log)) where the response variable is counts, offset by the
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
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)
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
2011 Mar 10
2
ERROR: gamm function (mgcv package). attempt to set an attribute on NULL
Hello:I run a gamm with following call :mode<-gamm(A~B,random=list(ID=~1),family=gaussian,na.action=na.omit,data=rs)an error happened:ERROR names(object$sp) <- names(G$sp) : attempt to set an attribute on NULLwith mgcv version 1.7-3What so? How can I correct the Error? Thanks very much for any help. [[alternative HTML version deleted]]
2010 Jul 28
1
strange error : isS4(x) in gamm function (mgcv package). Variable in data-frame not recognized???
Dear all, I run a gamm with following call : result <- try(gamm(values~ s( VM )+s( RH )+s( TT )+s( PP )+RF+weekend+s(day)+s(julday) ,correlation=corCAR1(form=~ day|month ),data=tmp) )" with mgcv version 1.6.2 No stress about the data, the error is not data-related. I get : Error in isS4(x) : object 'VM' not found What so? I did define the dataframe to be used, and the
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
2010 May 19
1
Displaying smooth bases - mgcv package
Dear all, for demonstration purposes I want to display the basis functions used by a thin plate regression spline in a gamm model. I've been searching the help files, but I can't really figure out how to get the plots of the basis functions. Anybody an idea? Some toy code : require(mgcv) require(nlme) x1 <- 1:1000 x2 <- runif(1000,10,500) fx1 <- -4*sin(x1/50) fx2 <-
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
2011 Mar 23
1
how to add in interaction terms in gamm
I want to use gamm to generate smoothed trend line for three groups identified by dummy variable genea and geneb. My question is how to add in an interaction term between the time and another dummy variable such as gender? fitm<-gamm(change_gfr~ genea+geneb+s(timea_n,bs="ps")+s(timeb_n,bs="ps")+s(timec_n,bs="ps"),data=mm,random=list(time_n=~1|PID)) -- View this
2006 Oct 25
1
Help with random effects and smoothing splines in GAMM
Try to fit a longitudinal dataset using generalized mixed effects models via the R function gamm() as follows: library(mgcv) gamm0.fit<- gamm(y ~ x+s(z,bs="cr"), random=list( x=~1, s(z,bs="cr")=~1 ), family = binomial, data =raw) the data is
2006 Nov 07
1
gamm(): nested tensor product smooths
I'd like to compare tests based on the mixed model representation of additive models, testing among others y=f(x1)+f(x2) vs y=f(x1)+f(x2)+f(x1,x2) (testing for additivity) In mixed model representation, where X represents the unpenalized part of the spline functions and Z the "wiggly" parts, this would be: y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 vs y=X%*%beta+ Z_1%*%b_1+ Z_2%*%b_2 + Z_12
2013 Jan 15
0
temporal and spatial correlation structures in GAMM
Dear R_help list members!   I’m studding forest carnivores and I have data on resting site selection and use!   I’m trying to model the probability that a forest carnivore might have in be located in a tree hollow (1) (the main resting site selected) rather than elsewhere (0) (other resting site types, dens, nests, etc.). The model should be related with several variables such as for instance:  
2008 Oct 13
0
gamm() and predict()
Dear All, I have a query relating to the use of the ?predict? and ?gamm? functions. I am dealing with large (approx. 5000) sets of presence/absence data, which I am trying to model as a function of different of environmental covariates. Ideally my models should include individual and colony as random factors. I have been trying to fit binomial models using the gamm function to achieve this. For
2010 May 28
1
Comparing and Interpreting GAMMs
Dear R users I have a question related to the interpretation of results based on GAMMs using Simon Woods package gamm4. I have repeated measurements (hours24) of subjects (vpnr) and one factor with three levels (pred). The outcome (dv) is binary. In the first model I'd like to test for differences among factor levels (main effects only): gamm.11<-gamm4(dv ~ pred +s(hours24), random = ~
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
2006 Jul 03
0
gamm and binomial data
Hello, I have a response variable that is a time series of 0's and 1's. And a couple of continous explanatory variables. I would like to fit a gamm with auto-correlation and binomial distribution using gamm in mgcv. Something simple like: tmp<-gamm(y ~ s(x), correlation=corAR1(), binomial) However, I read in various messages on this newsgroup that glmmPQL (used