[R-sig-ME] AR1 within test bouts with random intercept

Kogan, Clark cl@rk@kog@n @ending from w@u@edu
Mon Jan 7 22:26:34 CET 2019


That seemed to work.


From: Thierry Onkelinx <thierry.onkelinx using inbo.be>
Sent: Monday, January 7, 2019 1:22 AM
To: Kogan, Clark <clark.kogan using wsu.edu>
Cc: r-sig-mixed-models using r-project.org
Subject: Re: [R-sig-ME] AR1 within test bouts with random intercept

Dear Clark,

Have you tried something like corAR1(form = ~time|subj/period) This uses explict nesting. Your code uses implicit nesting and lme doesn't handle that.

Best regards,

ir. Thierry Onkelinx
Statisticus / Statistician

Vlaamse Overheid / Government of Flanders
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be<mailto:thierry.onkelinx using inbo.be>
Havenlaan 88 bus 73, 1000 Brussel
To call in the statistician after the experiment is done may be no more than asking him to perform a post-mortem examination: he may be able to say what the experiment died of. ~ Sir Ronald Aylmer Fisher
The plural of anecdote is not data. ~ Roger Brinner
The combination of some data and an aching desire for an answer does not ensure that a reasonable answer can be extracted from a given body of data. ~ John Tukey


Op wo 2 jan. 2019 om 20:40 schreef Kogan, Clark <clark.kogan using wsu.edu<mailto:clark.kogan using wsu.edu>>:

I am trying to fit a linear mixed effects model that has a random effect for subject and an AR1 correlation structure for time within period, where period is nested within subject. I am happy to treat time as either discrete or continuous - the time intervals within a period are all the same. I attempt to fit the following model and get an error.

mod <- lme(agg ~ tx_group + day + tx_group*day, random = ~1|subj, correlation = corAR1(form = ~time|subj_period), data = pw)

Error in lme.formula(agg ~ tx_group + day + tx_group * day, random = ~1 |  :
  incompatible formulas for groups in 'random' and 'correlation'

From a little online reading, it seems that lme likes to have the same grouping factor for the random effects and the correlation. I was wondering whether there are other tools that are currently available to fit this type of correlation structure.

Clark Kogan

        [[alternative HTML version deleted]]

R-sig-mixed-models using r-project.org<mailto:R-sig-mixed-models using r-project.org> mailing list

	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list