similar to: conducting GAM-GEE within gamm4?

Displaying 20 results from an estimated 140 matches similar to: "conducting GAM-GEE within gamm4?"

2011 Jul 19
2
Incorrect degrees of freedom for splines using GAMM4?
Hello, I'm running mixed models in GAMM4 with 2 (non-nested) random intercepts and I want to include a spline term for one of my exposure variables. However, when I include a spline term, I always get reported degrees of freedom of less than 1, even when I know that my spline is using more than 1 degree of freedom. For example, here is the code for my model: >
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)
2012 Nov 27
2
Help with graphics in gamm4 library
My problem is relatively straight forward, but I cannot seem to find a way to make it work. I have a RCBD with repeated measurements over time. I have created a fit using the gamm4 package. My model is: fit4a <- gamm4(Rate ~ s(Time,by=trt,bs="cr")+trt,data=qual.11.dat, random=~(1|block),correlation=corARH1()) What I would like to create is plots with the X-axis
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
2012 Aug 08
1
mgcv and gamm4: REML, GCV, and AIC
Hi, I've been using gamm4 to build GAMMs for exploring environmental influences on genetic ancestry. Things have gone well and I have 2 very straightforward questions: 1. I've used method=REML. Am I correct that this is an alternative method for estimating the smooth functions in GAMMs rather than GCV that is often used for GAMs? I've read up on REML and it makes sense, but I'm
2018 Jan 23
0
interaction term by a factor group in gamm4
Dear all, I am writing as I would really need your help on the problem with gamm4. I have tried to find a solution online but I wasn't very successful. I am running a gamm4 model with an interaction between two variable using the tensor term, t2. I have a group variable (super end group) with six factors; I would like to run the model to see the how the interaction term varies across 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 Jul 27
2
How can I access an element of a string?
Dear Daniel and Jorge, Thank you very much and it does help. If I have a string "ABCD", how can I access the second element of the string "B"? Thanks, Miao 2012/7/27 Daniel Nordlund <djnordlund@frontier.com> > > -----Original Message----- > > From: r-help-bounces@r-project.org [mailto:r-help-bounces@r-project.org] > > On Behalf Of jpm miao
2002 Aug 10
0
?subexpressions, D, deriv
Hi all, I am not used to using the computer to do calculus and have up to now done my differentiation "by hand" , calling on skills I learned many years ago and some standard cheat sheets. My interest at present is in getting the second derivative of a gaussian, which I did by hand and results in a somewhat messy result involving terms in sigma^5 .. I have done some spot checks
2012 Jul 27
2
How can I access the title of a table read via read.csv?
Hi, I have a table which I can read via read.csv: fx1<-read.csv(file="A_FX_M.csv", header=TRUE) TIME REER NTD JPY GBP HKD 1 198001 124.26 36.030 237.96 2.263980 4.8366 2 198002 126.59 36.030 244.05 2.290426 4.8765 3 198003 128.33 36.026 248.62 2.206045 4.9960 4 198004 127.85 36.063 251.67 2.215330 4.9760 5 198005 124.40 36.050 228.35 2.302026 4.8891 6 198006
2017 Jun 12
2
plotting gamm results in lattice
Dear all,? I hope that you can help me on this. I have been struggling to figure this out but I haven't found any solution. I am running a generalised mixed effect model, gamm4, for an ecology project. Below is the code for the model: model<-gamm4(LIFE.OE_spring~s(Q95, by=super.end.group)+Year+Hms_Rsctned+Hms_Poaching+X.broadleaved_woodland? ? ? ? ? ? ?+X.urban.suburban+X.CapWks,
2017 Jun 12
0
plotting gamm results in lattice
Hi Maria If you have problems just start with a small model with predictions and then plot with xyplot the same applies to xyplot Try library(gamm4) spring <- dget(file = "G:/1/example.txt") str(spring) 'data.frame': 11744 obs. of 11 variables: $ WATERBODY_ID : Factor w/ 1994 levels "GB102021072830",..: 1 1 2 2 2 3 3 3 4 4 ... $ SITE_ID
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 = ~
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 <-
2007 Sep 21
1
problem with 'integrate'
Hello - I am having a problem with the function 'integrate'. I am running R on OSX (R 2.5.1). I am trying to suppress the error message when 'integrate' attempts to integrate across a parameter set giving a non-finite function value. I'm using it in a MCMC / simulated annealing algorithm, and it is entirely possible that some parameter sets will give non-
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 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
2003 May 30
2
Coefficients: (20 not defined because of singularities)
Hello, I am trying to run a linear regression analysis on my data set. For some reason most variables are removed due to singularities. My linear regression looks this way (I am using only partial data, which is selected by flags): fm<-lm(log(cplex6.time..sec..[flags]) ~ cplex6.cities[flags] + log(1/features.meanOver.frust[flags]) + log(1/features.meanOver.minDist[flags]) + [...]
2013 Dec 05
0
mgcv gam modeling trend variation over cases
Dear R-Helpers, I posted two days ago on testing significance of random effects in mgcv, but realize I did not make my overall purpose clear. I have a series of N short time series, where N might range from 3-10 and short means a median of 20 time points. The sample data below (PCP) has N = 4 cases with 9, 13, 16 and 16 observations over time respectively. The data set contains four