[R] use of subset in lme function

amace aurelien.mace at unil.ch
Wed Feb 29 17:11:22 CET 2012

Dear all,

I have an issue concerning the lme function and I couldn't find the solution elsewhere.

I have a data frame with id, Ages, Parameter1 and Parameter2.
The Ages can belong to one of two categories "early" or "late". 

Then for example an id can have several values of Parameter1 at different ages in the "early" category (but only one value per age)

What I want to know is if Parameter1 at early Age "predict" Parameter2 at late Age, but I don't know how to create two subsets one for parameter1 and one for parameter2.
I would like something like:

lme(Parameter2_late ~ I + Parameter1_early, data = dataset, random = ~1|id, correlation = corAR1(0.2, form = ~Ages|id)

I hope I made myself clear.

Thanks for your help

More information about the R-help mailing list