Re: [R] Mixed Models providing a correlation structure.

2012-07-11 Thread Kevin Wright
Why did you use the 'lower.tri' syntax? Does this work for you? lme(Y~Random, data = DATA, random = list(Random = pdSymm(CovM,~Random))) Kevin On Wed, Jul 11, 2012 at 9:27 AM, Marcio wrote: > Dear Simon, > Thanks for the quick reply. > Unfortunately I don't have access to Pinheiro and Bates. I

Re: [R] Mixed Models providing a correlation structure.

2012-07-11 Thread Marcio
Dear Simon, Thanks for the quick reply. Unfortunately I don't have access to Pinheiro and Bates. I tried googling the pdSymm and lme but I still cannot get the syntax right. In my model, I only have 1 random factor with repetitions (groups) (e.g. 2 records per each level) I am pasting bellow a ver

Re: [R] Mixed Models providing a correlation structure.

2012-07-05 Thread Simon Blomberg
Aah. From your model description, you are more interested in the covariance structure of the random effects, rather than the residuals. You will then need to use the pdSymm class in the specification of the random effects. See Pinheiro and Bates pp 157-166. Cheers, Simon. On 06/07/12 11:43,

Re: [R] Mixed Models providing a correlation structure.

2012-07-05 Thread Simon Blomberg
You need to look at the corSymm correlation class for nlme models. Essentially, in your lme call, you need to do correlation=corSymm(mat[lower.tri(mat)], fixed=TRUE) Where mat is your (symmetric) variance-covariance matrix. Remember to make sure that the rows and columns of mat are in the sam

[R] Mixed Models providing a correlation structure.

2012-07-05 Thread Marcio
Hi folks, I was wondering how to run a mixed models approach to analyze a linear regression with a user-defined covariance structure. I have my model y = xa +zb +e and b ~ N (0, C*sigma_square). (and a is a fixed effects) I would like to provide R the C (variance-covariance) matrix I can easi