# Calculating weight as 1/(stnd error) for weighted regression if stnd error = 0

I'm assisting a colleague with a weighted regression of average length of stay (LOS) measured in days vs. inpatient admit rate in a dataset consisting of inpatient records from 30 hospitals. We've calculated the weight at each data point as the inverse standard error of patient's LOS at the hospital.

Is there a standard procedure for estimating the inverse stnd error weight where the stnd error = 0? In several hospitals with low patient volume the LOS is identical for all patients during our analysis time period, and therefore the stnd error = 0, producing a weight equal to infinity.

We could drop these data points from the regression (or avoid a weighted regression entirely), but in principle it seems there ought to be an accepted technique for calculating weights in special cases where the variance = 0. I haven't had any luck checking my stats textbooks.

Thank you for the advice, Michael and whuber. Most of the total error sum of squares can be attributed to measurement error in my case when I run a simple unweighted least squares regression (RSS=44.5, ESS=168.9, TSS=213.4).

So if I were to construct my own weighting scheme it might entail, at one extreme if variance=0 then the weight = # obs in that hospital, and at the other extreme, if variance=infinity, the weight=0.

Perhaps a handy formula could be weight_i = N_i/(N_i^CV_i), where weight_i = weight for hospital i, N_i = # obs for hospital i, and CV_i = Coefficient of Variation of observed LOS for hospital i?

• This is, at bottom, an issue of identifying and quantifying separate components of variance. Your weighting is appropriate when all variation can be attributed to the measurement error in LOS. Because you're doing a regression, there will likely be residuals: they will include a separate (independent) variance component. If, eyeballing the scatterplot, it appears the regression residuals will be larger than typical LOS SE's, then you are probably OK not weighting anything. The problem is more challenging otherwise, so first it would be good to do this check! What does it tell you? – whuber Sep 19 '12 at 19:21
• Just checking: you are weighting by the standard error of the mean for the $i$th observation: $\hat{s_i}/\sqrt{n_i}$, right? The $\sqrt{n_i}$ factor could be more important than the $\hat{s_i}$ factor – Andrew M Dec 1 '15 at 18:16
• @AndrewM - Yes, weighting by stnd error, although it's been 3 years so I'd have to search thru my files for the SAS code to be absolutely certain. – RobertF Dec 1 '15 at 18:32