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
covariate data errors
4 messages · Andy Jacobson, John Fox, Duncan Mackay +1 more
Dear Anthony, The gls (generalized least squares) function in the nlme package should do what you want. (I assume that your analysis leads you to expect an error-covariance matrix of a specific form with some free parameters to estimate.) Generalized least squares estimation is a common topic in regression texts. You'll find a brief appendix on the subject from my R and S-PLUS Companion to Applied Regression, in the context of time-series regression, at <http://www.socsci.mcmaster.ca/jfox/Books/Companion/appendix-timeseries-regression.pdf>. I hope that this helps, John
At 11:40 PM 6/12/2003 -0400, Andy Jacobson wrote:
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
----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox
Hello, I'm not qualified to judge about definitiveness, but you may find the discussion of "Time Series Regression and Generalized Least Squares" in Chapter 14 of "Applied Regression Analysis, Linear Models, and Related Models" by John Fox (1997, Sage Publications) helpful. He also has an accompanying package "car" on the CRAN R site. Duncan ***************************************** Dr. Duncan Mackay School of Biological Sciences Flinders University GPO Box 2100 Adelaide S.A. 5001 AUSTRALIA Ph (08) 8201 2627 FAX (08) 8201 3015 http://www.scieng.flinders.edu.au/biology/people/mackay_d/index.html -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Andy Jacobson Sent: Friday, 13 June 2003 1:10 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
Do you mean correlations in the *errors*? The residuals are always correlated. What does this have to do with your subject line -- it is errors in the dependent variable I think you mean? If you have correlated errors, you should be using generalized least squares not least squares or weighted least squares. (That is covered in all good books on regression: I don't know your level, but Seber's has a comprehensive account.) There are several R functions to fit GLS, including gls(nlme) and lm.gls(MASS).
On Thu, 12 Jun 2003, Andy Jacobson wrote:
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
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595