[R] lme for long.data

Murali Haran mharan at stat.umn.edu
Sun May 7 20:06:57 CEST 2000


Dear R users,

I am attempting to fit a model for longitudinal
data with the lme function.

"sim" is a data set with sim$Y as response, sim$time
as times of each observation, sim$id as patient
id's.

I try to do the following :
simcorExp <-corExp(form=(~time|id),nugget=T)
simcorExp <- initialize(simcorExp, data=sim)
sim.fit <- lme(fixed = Y~1, data=sim, random =
~1|id,correlation=simcorExp)

After just the second statement, R complains :
*****
Error in getGroups(data, form, level = grpLev) : 
        no applicable method for "getGroups"
*****

What am I doing wrong ?  Is this is the right
approach (for the model I describe below)?

Any tips or guidance would be really appreciated.

Murali

**********
P.S. The model I am trying to fit is as follows :

For each data point, y_ij at time
t_ij, I am trying to fit a random intercept for 
each patient, b_i, a term representing temporally 
correlated variability, v_ij, and measurement 
error term,e_ij.

y_ij = Mu + b_i + v_ij + e_ij

Mu is the overall intercept.
b_i is i.i.d N(0,sigma_b^2) 
e_ij's are i.i.d. N(0,sigma_eps^2)

each vector v_i has expectation (0,..,0) and 
covariance(v_i) uses the exponential semi-variogram
model (the continous analog of the first order
auto-regressive correlation model), i.e, the 
corr(v_ij,v_ik) = exp(eta* abs(t_ik - t_ij)).
The covariance matrix for (v_i) is multiplied
by the scalar sigma_v^2. Of course, the same 
eta and sigma_v^2 is fit across all patients.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list