[R] covariate data errors

Bill.Venables@csiro.au Bill.Venables at csiro.au
Fri Jun 13 06:51:10 CEST 2003


The function gls() in the nlme library will handle correlated observations
assuming that you have an easily specified pattern to the variances and
covariances (e.g. an AR(1) process).

If you just have an arbitrary variance matrix for the y-vector do not
despair.  You just have to do a few matrix algebra computations, with which
I am sure you are quite expert... The functions you will probably need are
simple ones like chol(), crossprod(), "%*%" and solve() so nothing too
difficult there.  You might want to start with model.matrix(), though, and
that's slightly more challenging for most people.

Bill Venables.

-----Original Message-----
From: Andy Jacobson [mailto:junkmail at mu.met.psu.edu]
Sent: Friday, June 13, 2003 1:40 PM
To: r-help at stat.math.ethz.ch
Subject: [R] covariate data errors


Greetings,

	I would like to fit a multiple linear regression model in
which the residuals are expected to follow a multivariate normal
distribution, using weighted least squares.  I know that the data in
question have biases that would result in correlated residuals, and I
have a means for quantifying those biases as a covariance matrix. I
cannot, unfortunately, correct the data for these biases.

	It seems that this should be a straightforward task, but so
much of the literature is concerned with the probability model in
which the residuals are uncorrelated that I can't find a good
reference.  So in order of importance, please, can someone point me to
a definitive reference for least squares with correlated residuals,
and is there a standard R package to handle this case?

	Many thanks in advance,

	Anthony

______________________________________________
R-help at stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help




More information about the R-help mailing list