Lecture notes about Heteroscedasticity, its consequences, detection, and remedy. Hetero or Heteroscedasticity is a violation of the OLS assumption of consistent variance.
To detect the presence of heteroscedasticity using the Park Glejser test, consider the following data.
Year
1992
1993
1994
1995
1996
1997
1998
Yt
37
48
45
36
25
55
63
Xt
4.5
6.5
3.5
3
2.5
8.5
7.5
The step-by-step procedure for conducting the Park Glejser test:
Step 1: Obtain an estimate of the regression equation
$$\hat{Y}_i = 19.8822 + 4.7173X_i$$
Obtain the residuals from this estimated regression equation:
Residuals
-4.1103
-2.5450
8.6071
1.9657
-6.6756
-4.9797
7.7377
Take the absolute values of these residuals and consider it as your dependent variables to perform the different functional forms suggested by Glejser.
Step 2: Regress the absolute values of $\hat{u}_i$ on the $X$ variable that is thought to be closely associated with $\sigma_i^2$. We will use the following function forms.
Since none of the residual regression is significant, therefore, the hypothesis of heteroscedasticity is rejected. Therefore, we can say that there is no relationship between the absolute value of the residuals ($u_i$) and the explanatory variable $X$.
The post is about “Heteroscedasticity Consistent Standard Errors and Variances.
$\sigma_i^2$ are rarely known. However, there is a way of obtaining consistent estimates of variances and covariances of OLS estimators even if there is heteroscedasticity.
White’s Heteroscedasticity Consistent Standard Errors and Variances
White’s heteroscedasticity-corrected standard errors are known as robust standard errors. White’s heteroscedasticity-corrected standard errors are larger (maybe smaller too) than the OLS standard errors and therefore, the estimated $t$-values are much smaller (or maybe larger) than those obtained by the OLS.
Comparing the OLS output with White’s heteroscedasticity consistent standard errors (variances) may be useful to see whether heteroscedasticity is a serious problem in a particular set of data.
Plausible Assumptions about Heteroscedasticity Patterns
Assumption 1: The error variance is proportional to $X_i^2$
$$E(u_i^2)=\sigma^2 X_i^2$$ It is believed that the variance of $u_i$ is proportional to the square of the $X$ (in graphical methods or Park and Glejser approaches).
Hence, the variance of $v_i$ is now homoscedastic, and one may apply OLS to the transformed equation by regressing $\frac{Y_i}{X_i}$ on $\frac{1}{X_i}$.
Notice that in the transformed regression the intercept term $\beta_2$ is the slope coefficient in the original equation and the slope coefficient $\beta_1$ is the intercept term in the original model. Therefore, to get back to the original model multiply the estimated equation (1) by $X_i$.
Assumption 2: The Error Variance is Proportional to $X_i$
The square root transformation: $E(u_i^2) = \sigma^2 X_i$
If it is believed that the variance of $u_i$ is proportional to $X_i$, then the original model can be transformed as
One may proceed to apply OLS on equation (a), regressing $\frac{Y_i}{\sqrt{X_i}}$ on $\frac{1}{\sqrt{X_i}}$ and $\sqrt{X_i}$.
Note that the transformed model (a) has no intercept term. Therefore, use the regression through the origin model to estimate $\beta_1$ and $\beta_2$. To get back the original model simply multiply the equation (a) by $\sqrt{X_i}$.
Consider a case of $intercept = 0$, that is, $Y_i=\beta_2X_i+u_i$. The transformed model will be
where $v_i=\frac{u_i}{E(Y_i)}$, and $E(v_i^2)=\sigma^2$ (a situation of homoscedasticity).
Note that the transformed model (b) is inoperational as $E(Y_i)$ depends on $\beta_1$ and $\beta_2$ which are unknown. We know $\hat{Y}_i = \hat{\beta}_1 + \hat{\beta}_2X_i$ which is an estimator of $E(Y_i)$. Therefore, we proceed in two steps.
Step 1: Run the usual OLS regression ignoring the presence of heteroscedasticity problem and obtain $\hat{Y}_i$.
Step 2: Use the estimate of $\hat{Y}_i$ to transform the model as
Although $\hat{Y}_i$ is not exactly $E(Y_i)$, they are consistent estimates (as the sample size increases indefinitely; $\hat{Y}_i$ converges to true $E(Y_i)$). Therefore, the transformed model (c) will perform well if the sample size is reasonably large.
Assumption 4: Log Transformation
A log transformation
$$ ln Y_i = \beta_1 + \beta_2 ln X_i + u_i \tag*{log model-1}$$ usually reduces heteroscedasticity when compared to the regression $$Y_i=\beta_1+\beta_2X_i + u_i $$
It is because log transformation compresses the scales in which the variables are measured, by reducing a tenfold (دس گنا) difference between two values to a twofold (دگنا) difference. For example, 80 is 10 times the number 8, but ln(80) = 4.3280 is about twice as large as ln(8) = 2.0794.
By taking the log transformation, the slope coefficient $\beta_2$ measures the elasticity of $Y$ concerning $X$ (that is, the percentage change in $Y$ for the percentage change in $X$).
If $Y$ is consumption and $X$ is income in the model (log model-1) then $\beta_2$ measures income elasticity, while in the original model (model without any transformation: OLS model), $\beta_2$ measures only the rate of change of mean consumption for a unit change in income.
Note that the log transformation is not applicable if some of the $Y$ and $X$ values are zero or negative.
Note regarding all assumptions about the nature of heteroscedasticity, we are essentially speculating (سوچنا، منصوبہ بنانا) about the nature of $\sigma_i^2$.
There may be a problem of spurious correlation. For example, in the model $$Y_i = \beta_1+\beta_2X_i + u_i,$$ the $Y$ and $X$ variables may not be correlation but in transformed model $$\frac{Y_i}{X_i}=\beta_1\left(\frac{1}{X_i}\right) + \beta_2,$$ the $\frac{Y_i}{X_i}$ and $\frac{1}{X_i}$ are often found to be correlated.
$\sigma_i^2$ are not directly known, we estimate them from one or more of the transformations. All testing procedures are valid only in large samples. Therefore, be careful in interpreting the results based on the various transformations in small or finite samples.
For a model with more than one explanatory variable, one may not know in advance, which of the $X$ variables should be chosen for transforming data.
Heteroscedasticity in Regression: The term heteroscedasticity refers to the violation of the assumption of homoscedasticity in linear regression models (LRM). In the case of heteroscedasticity, the errors have unequal variances for different levels of the regressors, which leads to biased and inefficient estimators of the regression coefficients. The disturbances in the Classical Linear Regression Model (CLRM) appearing in the population regression function should be homoscedastic; that is they all have the same variance.
Mathematical Proof of $E(\hat{\sigma}^2)\ne \sigma^2$ when there is some presence of hetero in the data.
For the proof of $E(\hat{\sigma}^2)\ne \sigma^2$, consider the two-variable linear regression model in the presence of heteroscedasticity,
If there is homoscedasticity, then $\sigma_i^2=\sigma^2$ for each $i$, $E(\hat{\sigma}_i^2)=\sigma^2$.
The expected value of the $\hat{\sigma}^2=\frac{\hat{u}_i^2}{n-2}$ will not be equal to the true $\sigma^2$ in the presence of heteroscedasticity.
To address heteroscedasticity in regression analysis, several techniques can be used to stabilize the variance of the errors:
Transformations: Transforming the variables (such as using logarithmic or square root transformations) can sometimes help stabilize the variance of the errors.
Weighted Least Squares (WLS): WLS is a method that assigns different weights to observations based on their variances, thereby giving more weight to observations with smaller variances. This may also help to mitigate the impact of heteroscedasticity on the estimation of parameters.
Robust Standard Errors: heteroscedasticity-consistent standard errors also known as Robust standard errors, provide a way to correct standard errors and hypothesis tests in the presence of heteroscedasticity without requiring assumptions about the specific form of heteroscedasticity.
Generalized Least Squares (GLS): The GLS method allows to estimation of regression coefficients under a broader range of assumptions about the variance-covariance structure of the errors, including heteroscedasticity.
Overall, detecting and addressing heteroscedasticity is important for ensuring the validity and reliability of regression analysis results.