[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


Thierry,

That seemed to work.

Thanks,
Clark

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
INSTITUUT VOOR NATUUR- EN BOSONDERZOEK / RESEARCH INSTITUTE FOR NATURE AND FOREST
Team Biometrie & Kwaliteitszorg / Team Biometrics & Quality Assurance
thierry.onkelinx using inbo.be<mailto:thierry.onkelinx using inbo.be>
Havenlaan 88 bus 73, 1000 Brussel
www.inbo.be<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.inbo.be&d=DwMFaQ&c=C3yme8gMkxg_ihJNXS06ZyWk4EJm8LdrrvxQb-Je7sw&r=oEbEbiEeg32ENfvrFY6o9qTkkdIivEvx2vWVghVoM8I&m=Infad875ZIbPiowJ57tbsFHA_gftmw8-sgq5z0hue5I&s=r1olaq9nnnxgW91JEU2Hb5pkcP3g3zbAjBMfbHtq7jA&e=>
///////////////////////////////////////////////////////////////////////////////////////////
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
///////////////////////////////////////////////////////////////////////////////////////////

[https://inbo-website-prd-532750756126.s3-eu-west-1.amazonaws.com/inbologoleeuw_nl.png]<https://urldefense.proofpoint.com/v2/url?u=https-3A__www.inbo.be&d=DwMFaQ&c=C3yme8gMkxg_ihJNXS06ZyWk4EJm8LdrrvxQb-Je7sw&r=oEbEbiEeg32ENfvrFY6o9qTkkdIivEvx2vWVghVoM8I&m=Infad875ZIbPiowJ57tbsFHA_gftmw8-sgq5z0hue5I&s=glLvHK1d3wde4cvsto5Ok6JkzCwWnMb6Y0EAKi8TSnM&e=>


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

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.

Thanks,
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
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models<https://urldefense.proofpoint.com/v2/url?u=https-3A__stat.ethz.ch_mailman_listinfo_r-2Dsig-2Dmixed-2Dmodels&d=DwMFaQ&c=C3yme8gMkxg_ihJNXS06ZyWk4EJm8LdrrvxQb-Je7sw&r=oEbEbiEeg32ENfvrFY6o9qTkkdIivEvx2vWVghVoM8I&m=Infad875ZIbPiowJ57tbsFHA_gftmw8-sgq5z0hue5I&s=oScK9lsBY2syXlvS4j7GNbmUkqGBMAVjKz2ECP_DH-g&e=>

	[[alternative HTML version deleted]]



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