[R] An "unsubsettable object" in a mixed model

Ben Bolker bbolker at gmail.com
Wed Jan 18 15:34:02 CET 2012


sj414 <sj414 <at> medschl.cam.ac.uk> writes:

> R has no problem with a command of the type
>   model<-lme(Y~f(x),random=~x|z)
> but returns that error message when the command becomes something like
>    model<-lme(Y~f(X),random=~x|z,correlation=corCompSymm)
> Y is a vector of single observations from 2099 individuals, X is the
> covariate matrix of which x is one column, z is the family numbers; 1-1801.
> It seems to be the addition of dependence which causes the problem.

  Yes, because correlation=corCompSymm is not how you're supposed
to specify the correlations: rather, it should look something like

  model <- lme(Y~a+b*X,random=~x|z,correlation=corCompSymm(form=~1|z))


although I think you might be able to get away with

  model <- lme(Y~a+b*X,random=~x|z,correlation=corCompSymm())

  Two more thoughts:

* as I said before, this might be better suited to the r-sig-mixed-models
list
* finding a copy of Pinheiro and Bates 2000 would definitely be a good
idea if you're going to deal with correlation structures in lme much
more ...

  Ben Bolker



More information about the R-help mailing list