Book Image

Data Analysis with STATA

Book Image

Data Analysis with STATA

Overview of this book

Table of Contents (16 chapters)
Data Analysis with Stata
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Homoscedasticity


One of the major assumptions given for type ordinary least squares regression is the homogeneity in the case of variance of the residuals. In the case of a well-fitted model, if you plot residual values versus fitted values, you should not see any particular pattern. Now, what if the variance given by the residuals is not a constant? In this case, the residual variance is called heteroscedastic. You can detect the heteroscedasticity in various graphical and non-graphical ways.

The most commonly used way to detect heteroscedasticity is by plotting residuals versus predicted values. In Stata, we can perform this using the rvfplot command. When we leverage the rvfplot command with the option of yline(0), which is defining the basis of Y equal to 0, we can see that the data point pattern can get narrower as we move toward the right-hand side. This indicates that heteroscedasticity exists:

rvfplot, yline(0)

After running the preceding code, you get the following diagram:

One of...