Comprehensive Stata do-file for testing and correcting violations of classical OLS assumptions
This repository contains a single Stata do-file that implements a full suite of diagnostic tests and remedies for violations of the classical linear regression assumptions in cross-sectional data:
- Model Specification
- Heteroskedasticity
- Multicollinearity
- Spatial Autocorrelation
- Endogeneity
- Residual Normality
- Outlier & Influence Detection
- Clone this repository:
git clone https://github.com/your-username/OLS-Diagnostics-Stata.git
- Open Stata and run the do-file
- Review the log output and graphs to identify any assumption violations.
- Apply the suggested corrective commands included in each section if needed.
.
├── Regression Assumptions.do # Main Stata script with all tests & remedies
├── Lawsch85.xlsx # Dataset used to run the script
└── README.md # Project documentation
Contributions are welcome! Please open issues or submit pull requests at
https://github.com/pablo-reyes8
This project is licensed under the Apache License 2.0.
Feel free to open issues or submit pull requests to add more diagnostics, improve formatting, or support panel/time-series extensions.