SPREAD Option |
SPREAD=SERIES/FRML/expression with assumed residual variances (at least to a scale factor)
Use the SPREAD option to perform weighted least squares to correct for heteroscedasticity. With this option you provide a series or expression to which the residual variances are assumed to be proportional. ("WEIGHT" options on many packages require you to indicate the reciprocal square root of this series). Note that there is a separate WEIGHT option which is for probability-weighted (or stratified) estimates, which is not the same as a heteroscedasticity correction.
Examples
If variances are assumed to be proportional to the series INCOME:
linreg(spread=income) food
# constant income
This does "feasible" GLS for correcting heteroscedasticity assumed to be proportional to some (unknown) power of INCOME, estimating that by a linear regression of the log of the squared residuals on log income. That's exp(..)'ed to produce the estimate of the spread series.
set esq = log(%resids^2)
set z = log(income)
*
linreg esq
# constant z
*
prj vhat
linreg(spread=exp(vhat)) food
# constant income
Copyright © 2025 Thomas A. Doan