Displaying 20 results from an estimated 34 matches for "corcar1".
Did you mean:
corar1
2011 Oct 05
2
gamm: problems with corCAR1()
...ot;0.5"),k=6) +
s(Week,by=as.numeric(Treatment=="5"),k=6) +
s(Week,by=as.numeric(Treatment=="15"),k=6) +
s(Week,by=as.numeric(Treatment=="50"),k=6) +
s(Week,by=as.numeric(Treatment=="150"),k=6) +
s(Treatment,k=6,fx=FALSE) + factor(Treatment),
correlation=corCAR1(form=~Week|factor(Treatment),data=indices,family=gaussian)
I seem to be having difficulties with the correlation structure. An initial
error occurred because replicates were taken at the same time:
/Error in Initialize.corCAR1(X[[2L]], ...) :
Covariate must have unique values within groups for c...
2005 May 25
1
question: corCAR1 in lme
...ons. Based
on the help files, two separate threads from the archives, and the Pinheiro
and Bates nlme 3.0 manual, I became confused about which of two ways to
check for a first-order temporal autocorrelation:
Chla.1b <- lme(Chla ~ Temp*Light* Time - Temp*Light, random = ~1 | TankID,
corr = corCAR1(form = ~Time | TankID), method="ML")
Chla.1c <- lme(Chla ~ Temp*Light* Time - Temp*Light, random = ~1 | TankID,
corr = corCAR1(form = ~1 | TankID), method="ML")
Comparing these fits with inspection of plot(ACF(chla.model1),alpha=0.05)
suggests to me that there are problem...
2006 Jul 18
2
Using corStruct in nlme
I am having trouble fitting correlation structures within nlme. I would like to
fit corCAR1, corGaus and corExp correlation structures to my data. I either
get the error "step halving reduced below minimum in pnls step" or
alternatively R crashes.
My dataset is similar to the CO2 example in the nlme package. The one major
difference is that in my case the 'conc' ste...
2009 Feb 12
1
Setting optimizer in lme
...R> library(car) # for data only
R> data(Blackmoor) # from car
R> Blackmoor$log.exercise <- log(Blackmoor$exercise + 5/60, 2)
R> attach(Blackmoor)
R> lme(log.exercise ~ I(age - 8)*group,
+ random = ~ I(age - 8) | subject,
+ correlation = corCAR1(form = ~ age-8|subject),
+ data=Blackmoor)
Error in lme.formula(log.exercise ~ I(age - 8) * group, random = ~I(age
- :
nlminb problem, convergence error code = 1
message = iteration limit reached without convergence (9)
This converged in the example that I am studying.
H...
2011 May 27
1
continuous time AR(1)
Dear R helpers,
I would like to model temporal trend of biological remains in sediment cores.
All samples are temporally auto-correlated and I would like to take this effect
into account.
Initially I thought that I could use AR(1) or ARIMA functions but these
functions only work with regular temporal intervals between samples.
Hence I would like to use a continuous time AR(1) that allow
2005 Nov 07
1
repeated values, nlme, correlation structures
...rst fit with nlme using the mean of
each group. Comparing several models, the best fit is:
modm0c<-nlme(pds~Asym/(1+exp((xmid-age)/scal)),
fixed=list(Asym~1,xmid~1,scal~1),
random=Asym+xmid~1|nichoir,data=croispulm,
start=list(fixed=c(10,5,2.2)),
method="ML",
corr=corCAR1()
)
with pds = weight, age = mean age of each age group, nichoir = nestbox
(a factor of 17 levels)
Based on the empirical autocorrelation function of the normalised
residuals drawn from this model one can acceptaly assume that the
normalized residuals behave like uncorrelated noise.
Thou...
2011 Dec 07
1
MIXED MODEL WITH REPEATED MEASURES
...ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random =
~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr
= corAR1())
I assume this can't be the right specification since it neglects the
repeated measure aspect of the data, so I instead decided to employ the
corCAR1 structure, i.e.--
ModelFit <- lme(fixed = DepVar ~FixedVar1+FixedVar2, random =
~RandomVar1+RandomVar2 | Subject, na.action = na.omit, data = dataset, corr
= corCAR1(0.5, form = ~ Years | Subject))
Now perhaps neither correlation structure is the right one (probably a
different discussion for...
2010 Apr 14
1
creating a new corClass for lme()
Hi,
I have been using the function lme() of the package nlme to model grouped
data that is auto-correlated in time and in space (the data was collected on
different days via a moving monitor). I am aware that I can use the
correlation classes corCAR1 and corExp (among other options) to model the
temporal and spatial components of the auto-correlation. However, as far as
I can tell, I can only model using one correlation class or the other. I
would like my model to account for both temporal and spatial autocorrelation
simultaneously.
The ?corCl...
2009 May 18
1
Predicting complicated GAMMs on response scale
...b=1.5, cex.axis=1,lwd=2)
lines(p.d$DaysPT,b$fit+b$se.fit*1.96,lty=2,lwd=1.5)
lines(p.d$DaysPT,b$fit-b$se.fit*1.96,lty=2,lwd=1.5)
points(DaysPT,Diff)
However, when I add a correlation structure and/or a variance structure so
that the model may look like:-
gamm(Diff~s(DaysPT3)+AirToC,correlation=corCAR1(form=~DaysPT|Animal),weights=varPower(form=~DaysPT),method="REML")
I get this message at the point of inputting the line
"b<-predict.gam(g.m$gam,p.d,se=TRUE)"
Error in model.frame(formula, rownames, variables, varnames, extras,
extranames, :
variable lengths dif...
2009 Jun 26
1
Alternate error structures in lme4?
Hi R users,
The nlme library enabled several alternate error structures useful for
longitudinal or repeated-measures data. For example, a continuous AR(1)
process:
model_2 = update(model_1, correlation = corCAR1(form = ~ time | subject))
Does anybody know if this is available in lme4?
Thank you
Ben
--
View this message in context: http://www.nabble.com/Alternate-error-structures-in-lme4--tp24226643p24226643.html
Sent from the R help mailing list archive at Nabble.com.
2007 Jun 25
0
correlation structure
...odel by:
update(model, corr=corCompSymm(~1|bas))
This is not significant. One of my variables measures area upstream of the sample. Area is a continuous variable, and there are some identical values of area. Can I model the dependence among residuals with in group (bas) and along area? Can the corCAR1 be used and the area used as a position variable? If so does the position variable need to be sorted when using the corCAR1 structure? Or could one use spatial classes and use area as one position and watershed as the other substituting numbers for the grouping variable? I have been trying, but...
2011 Mar 29
1
lme:correlationstructure AR1 and random factor
...n 5 sessions within a field (n=12) with ten traps in
one field.
res2a <- lme(response~x+y+z+treatment),correlation =
corARMA(form = ~ session|trapfield, p = 1, q = 0), random=~1|field,
na.action=na.omit, data=plates, method="ML")
res2a <- lme(response~x+y+z+treatment,correlation =
corCAR1(form = ~ session|trapfield), random=~1|field, na.action=na.omit,
data=plates, method="ML")
Error: Incompatible formulas for groups in "random" and "correlation"
What is the problem?
thanks a lot!
Yvonne
--
View this message in context: http://r.789695.n4.nabble.com...
2006 Dec 01
1
mixed effects model and r-squared
Heya
I am fitting linear mixed effects model in R and want to assess the model fit (with Animal number as random factor; repeated measures for Animals):
ts.model <- lme(LOG_FOC_MW ~ R_DN_SUM + ANIMAL + SEX+ YY, data = t.data, random = ~ 1 | ANIMAL, correlation=corCAR1(0.2, form = ~1 | ANIMAL ), method='ML', na.action=na.omit)).
Is there a possability to easly compute an R-square from the output of the model summary?
I would appreciate any hint.
Best regards
Lukas
???
Lukas Indermaur, PhD student
eawag / Swiss Federal Institute of Aquatic...
2005 Apr 27
1
Is this a bug in R?
Dear all,
I am trying to fit a nonlinear model with a autocorrelation term, but everytime I type in the command, I got an error message from Winwows and R closes itself.
The command line is as follows:
mod1<-nlme(V~A*exp(-B*A.O)*Vac.t.1.,data,fixed=A+B~1,random=A+B~1|ORDINAL,+
correlation=corCAR1(0.3179,~A.O|ORDINAL,TRUE),start=c(A=1.2,B=0.2))
I have already fitted this model allowing Phi to vary while optimizing, and it was fine, but as soon as I try to keep it fixed (argument "TRUE"), I simply can't
I don't get any error message from R, just a Windows error seying some...
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 and Berger's lmeChgPt model seems to
go some way to fitting the requirements for such a model but does not
incorporate, as...
2005 Apr 26
1
Error in nonlinear mixed-effects model
...inear regression to the data, but I keep having problems with NLME.
I have defined my data as a groupedData object, and when I try to fit the model I get this error message:
dat<-groupedData(V~VAC|ID,data=dat)
attach(dat)
mod<-nlme(V~A*exp(B*YEAR)*VAC, fixed=A+B~1, random=A+B~1, correlation=corCAR1(), start=c(A=1.2,B=0.2))
Error in getGroups.data.frame(dataMix, eval(parse(text = paste("~1", deparse(groups[[2]]), :
Invalid formula for groups
Do you have any clue of what?s happening? It?s the first time I fit a model like this in R, so the problem is probably pretty obvious...
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 dataframe
contains a variable VM :
> str(tmp)
'data.fram...
2008 Sep 29
1
Testing this significance of a factor in a mixed-model "ANCOVA"
...asurements for a developmental series of two capuchin monkey
species. I'm interested in whether the rate of bone length scaling
to body mass (i.e., growth) differs between species.
My call to lme looks like this:
model=lme(lghumlen ~ species + lgbmkg, random= ~ lgbmkg | id,
correlation=corCAR1(), weights=varExp())
where lghumlen is the log of humerus length and lgbmkg is the log of
body mass.
If I ask for a summary of my model, I get this from the table of
fixed effects:
Fixed effects: lghumlen ~ species + lgbmkg
Value Std.Error DF t-value p-value
(Int...
2005 Jan 05
1
subsetting within a function using lme
Thankyou for your help with subsetting within a function. I have now tried
to apply the same theory in the framework of an lme as follows:
fit1.lme <- eval(substitute(lme(fixed=fixed, data=dataframe,
random=random, correlation=corCAR1(form= corr), na.action=na.omit,
subset=subset),list(subset=subs)))
but I get the following error:
Error in switch(mode(object), name = , numeric = , call = object,
character = as.name(object), :
[[ cannot be of mode logical
I'm not sure why. Can anyone help me with this?
kind regard...
2006 Mar 04
1
replicated time series - lme?
...lculate the correlation of lag 1 over 17 replicates
a<-0
for (i in 1:17)
{
c<-ts( cover[run==i] )
d<-acf( c, lag=1, plot=F)
a<-a+d$acf[2]
}
a<-a/17
a
#[1] 0.9021463
#mixed effects model
model1<-lme(cover~t,random=~t|run, method="ML")
model2<-update(model1,correlation=corCAR1(0.902,form=~t|run))
anova(model1,model2)
But this just gives significance for a lag of 1, so I tried to find out the
correlation at greater lags with arima to be able to use corARMA() as
correlation structure:
arima(cover[run==1],order=c(100,0,0))
#does not work: ?error in polyroot(z): polynomia...