Re: [R] Weight matrix in linear regression

2012-11-29 Thread Mikołaj Hnatiuk
Hello, is there a way to compute multilevel (3-stage) regression using weights matrix (on different levels, just like in HLM) in R ? The nlme package doesn't seem to get the job done. Do you have any suggestions ? I _really_ don't want to use HLM to do this. Best, Mikołaj Hnatiuk 2012/11/29 Greg

Re: [R] Weight matrix in linear regression

2012-11-29 Thread Greg Snow
The gls function in the nlme package is one approach. If you know the covariance matrix exactly (it is just numerical with nothing that needs to be estimated) then you can also take the Cholesky decomposition of the inverse of the covariance matrix (or other square root method) and multiply the x

[R] Weight matrix in linear regression

2012-11-28 Thread Emese Vágó
Hi all, I would like to do a weighted linear regression, when the error of the dependent variable is correlated. So I have a weighting (covariance) matrix instead of a vector. As I understood the „weights” argument in the lm function should be a vector and not a matrix. Can anyone suggest m