Heteroscedasticity in Regression (2020)

Heteroscedasticity in Regression

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,

\begin{align}
Y_i=\beta_1 + \beta_2 X+ u_i, \quad\quad (eq1)
\end{align}

where $Var(u_i)=\sigma_i^2$ (Case of heteroscedasticity)

as

\begin{align}
\hat{\sigma^2} &= \frac{\sum \hat{u}_i^2 }{n-2}\\
&= \frac{\sum (Y_i – \hat{Y}_i)^2 }{n-2}\\
&=\frac{(\beta_1 + \beta_2 X_i + u_i – \hat{\beta}_1 -\hat{\beta}_2 X_i )^2}{n-2}\\
&=\frac{\sum \left( -(\hat{\beta}_1-\beta_1) – (\hat{\beta}_2 – \beta_2)X_i + u_i \right)^2 }{n-2}\quad\quad (eq2)
\end{align}

Noting that

\begin{align*}
(Y_i-\hat{Y}_i)&=0\\
\beta_1 + \beta_2 X + u_i\, – \,\hat{\beta}_1 – \hat{\beta}_2X &=0\\
-(\hat{\beta}_1 -\beta_1) – X(\hat{\beta}_2-\beta_2) – u_i & =0\\
(\hat{\beta}_1 -\beta_1) &= – X (\hat{\beta}_2-\beta_2) + u_i\\
\text{Applying summation on both side}&\\
\sum (\hat{\beta}_1-\beta_1) &= -(\hat{\beta}_2-\beta_2)\sum X + \sum u_i\\
(\hat{\beta}_1 – \beta_1) &= -(\hat{\beta}_2-\beta_2)\overline{X}+\overline{u}
\end{align*}

Substituting it in (eq2) and taking expectation on both sides:

\begin{align}
\hat{\sigma}^2 &= \frac{1}{n-2} \left[ -(-(\hat{\beta}_2 – \beta_2) \overline{X} + \overline{u} ) – (\hat{\beta}_2-\beta_2)X_i + u_i  \right]^2\\
&=\frac{1}{n-2}E\left[(\hat{\beta}_2-\beta_2)\overline{X} -\overline{u} – (\hat{\beta}_2-\beta_2)X_i-u_i \right]^2\\
&=\frac{1}{n-2} E\left[ -(\hat{\beta}_2 – \beta_2)(X_i-\overline{X}) + (u_i-\overline{u})\right]^2\\
&= \frac{1}{n-2}\left[-\sum x_i^2 Var(\hat{\beta}_2) + E[\sum(u_i-\overline{u}]^2 \right]\\
&=\frac{1}{n-2} \left[ -\frac{\sum x_i^2 \sigma_i^2}{(\sum x_i^2)} + \frac{(n-1)\sum \sigma_i^2}{n} \right]
\end{align}

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.


Heteroscedasticity in regression

To address heteroscedasticity in regression analysis, several techniques can be used to stabilize the variance of the errors:

  1. Transformations: Transforming the variables (such as using logarithmic or square root transformations) can sometimes help stabilize the variance of the errors.
  2. 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.
  3. 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.
  4. 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.

Read more on the Remedy of Heteroscedasticity

More on heteroscedasticity on Wikipedia

MCQs General Knowledge

R Programming Language

Residuals plot for Detection of Autocorrelation (2020)

The existence and pattern of autocorrelation may be detected using a graphical representation of residuals obtained from ordinary least square regression. One can draw the following residual plot for the detection of autocorrelation:

Detection of Autocorrelation from Residual Plots

  • A plot of the residual plot against time.
  • A plot of the $hat{u}_t$ against $hat{u}_{t-1}$
  • A plot of standardized residuals against time.

Note that the population disturbances $u_t$ are not directly observable, we use their proxies, the residuals $hat{u}_t$.

Detection of Positive negative autocorrelation
  • A random pattern of residuals indicates the non-presence of autocorrelation.
  • A plot of residuals for detection of residuals used for visual examination of $hat{u}_t$ or  $hat{u}_t^2$ can provide useful information not only about the presence of autocorrelation but also about the presence of heteroscedasticity. Similarly, the examination of $hat{u}_t$ and $hat{u}_t^2$ provides useful information about model inadequacy or specification bias too.
  • The standardized residuals are computed as $frac{u_t}{hat{sigma}}$ where $hat{sigma}$ is standard error of regression.
Residuals plot for Autocorrelation

Note: The plot of residuals against time is called the sequence plot. For time-series data, the researcher can plot (graphically draw) the residuals versus time (called a time sequence plot), he may expect to observe some random pattern in the time series data, indicating that the data is not autocorrelated. However, if the researcher observes some pattern (other than random) in the graphical representation of the data, then it means that the data is autocorrelated. The existence of some patterns shown in the above Figure can be used for the detection of autocorrelation.

See more on Autocorrelation

R and Data Analysis

RecordCast – Recording the Screen in One Click

A tutorial about RecordCast: Screen Recording Tool.

Have you ever made video tutorials? Have you ever recorded your computer screen? Indeed, many tutorials are done from the video of a computer screen. This enables Internet users to follow the various steps to follow to resolve a problem or use new software. If you want to instantly record the actions you take in a desktop window without sharing or recording information from your computer, the free online RecordCast‌ Screen Capture tool (RecordCast – Recording the Screen) is what you are looking for!

RecordCast - Recording the Screen

What is RecordCast?

It is a simple web-based tool to record or capture your screen without using third-party apps. All records are processed in the browser, and nothing is saved on the server. It is supported in modern browsers like Chrome, Edge, Firefox, and more.

RecordCast – Recording the Screen is very easy to use, with the essential ability to record everything that happens on our screen, with or without sound. After recording, you can edit the created video, adding text (it has several templates for entering text), images, audio, etc. You can also cut the video and isolate the pieces you want or do not want.

RecordCast

How RecordCast Screen Recorder works

  • Open your browser and go to the service.
  • All you have to do now is click on the “start recording” button in the center.
  • You can choose the type of recording you want, including screen+webcam, screen only, or webcam only.
  • It is possible to record microphone, system audio, or mute audio while recording your screen.
  • After allowing or forbidding the recording, you can make the necessary settings of the recording media available to start your screen’s recording process.
  • You now have three options: select the entire screen, the application window, or the Chrome tab. If you select an application window, the service will show all open windows. If you select a Chrome tab, all open tabs will be displayed in the list.
  • After selecting an app or screen, tap on the record button.
  • After you’ve finished recording, you will have the option to load the recording or start a new recording by deleting the clip.
  • It is available to edit the recorded video in a built-in editor provided by RecordCast, but you need to create a free account now.
RecordCast

In conclusion

RecordCast – Recording a Screen is a great tool for YouTubers, bloggers, and presentations as it gives you everything you need to make a cool show. Some cool features of RecordCast are free, and you can connect a microphone to comment on your video or a webcam, where you can be seen while you are filming.

The only minus we could find about the program is that it only allows you to film for 30 minutes now, which can feel like a very short time. However, the program is good to use if you are inexperienced in making screenshots, as it is incredibly easy to use. In addition, the quality of the recording itself is also really good.

Of course, there are other free web-based screen capture programs, but I do not have enough hands-on experience with them to comment on them. Is RecordCast something you can use? Do you know other and better alternatives? I would love to hear what you think, so leave a comment and make us all smarter!

SPSS Data Analysis

Online MCQs Quiz Website