# Weighted regression

## Weighted regression with "*** AutoWeight 1/SD^2 ***" dummy variable

In the dialog box for Regression, the first item in the drop-down list for Weights is the dummy variable "*** AutoWeight 1/SD^2 ***".

When you select this dummy variable "*** AutoWeight 1/SD^2 ***" for Weights, then MedCalc will follow an automatic weighted regression procedure that takes into account heteroscedasticity, according to Neter et al. (1996).

MedCalc will do that by performing the following steps in the background:

- Fit the regression model by unweighted least squares.
- Estimate the standard deviation function by regressing the absolute residuals on the independent variable.
- Use the fitted values from the estimated standard deviation function to obtain weights.
$$ weight = \frac{1}{SD^2} $$
- Estimate the regression coefficients using these weights.

For more details, see Weighted regression - worked example.

## Literature

- Neter J, Kutner MH, Nachtsheim CJ, Wasserman W (1996) Applied linear statistical models. 4
^{th}ed. Boston: McGraw-Hill.