s-news
[Top] [All Lists]

Re: weighted regression

To: David L Lorenz <lorenz@usgs.gov>
Subject: Re: weighted regression
From: Prof Brian Ripley <ripley@stats.ox.ac.uk>
Date: Wed, 21 Dec 2005 13:24:12 +0000 (GMT)
Cc: Snews <s-news@wubios.wustl.edu>
In-reply-to: <OF9958B634.5ECB9194-ON862570DC.004EF840-862570DC.00513C0D@usgs.gov>
References: <OF9958B634.5ECB9194-ON862570DC.004EF840-862570DC.00513C0D@usgs.gov>
On Mon, 19 Dec 2005, David L Lorenz wrote:

 We have a situation where we know the variance of observations for a
linear regression problem and need confidence limits on the parameter
estimates.

The documentation in the NOTES section for lm states "In addition, S-PLUS does not currently support weighted regression when the absolute precision of the observations is known. This situation arises often in physics and engineering, when the uncertainty associated with a particular measurement is known in advance due to properties of the measuring procedure or device. If you know the absolute precision of your observations, it is possible to supply them to the weights argument. This computes the correct coefficients for your model, but the standard errors and other inference tools will be incorrect."

I have searched the web, done bibliographic searches, and even searched the documentation for a competing product and I found nothing regarding the solution of this problem. I would be surprised if this problem has not been solved because it should be a high priority in physics. At least I remember it being an issue in physics classes, if not in the engineering classes I took.

Physicists optimistically think they know their error variances, but rarely do. Chemists used to think the same, but have learnt about the many possible sources of error and that the precision quoted by their instrumentation is nothing more than the between-readings instrumentation variability, ignoring for example calibration errors, operator differences let alone sample preparation variability.

Your quote is a bit out of context. You can fit (correctly) a weighted regression via lm, and lm does not quote standard errors. Rather, summary.lm does and that does not allow you to specify the error variance. However, you can fit the same model by glm(), and summary.glm() does allow you to specify the error variance. As a quick check:

x <- seq(2, 10, len=100)
v <- x
y <- x + sqrt(v)*rnorm(100)
fit <- glm(y ~ x, weights = 1/v)
summary(fit, dispersion = 1)

appears to have done the correct things. (Setting dispersion=1 means that the inverse weights are the variances and not merely proportional to them.) If you do that, do check that the residual SS is about the size predicted by the theory (a chisq distribution, with df=n-p, 98 in my example). Being large indicates model inadequacy, often in the variance specification in my experience.

 Is anyone aware of an approach to estimating the confidence limits of
parameter estimates when the variance of the observations is known? I
think I can see a solution for the case of equal known variance, but I
don't know that I have the ability to apply that to unequal
variances.Thanks.
Dave


--
Brian D. Ripley,                  ripley@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

<Prev in Thread] Current Thread [Next in Thread>