This project was designed as an in-depth study of regression analysis, with a primary focus on understanding and practicing the underlying statistical and mathematical theory rather than treating regression as a black-box modeling technique.
The objective was to manually implement core regression concepts and compare the results with established R and Python libraries to gain a detailed understanding of estimation, inference, and model evaluation.
- Developed and validated multiple linear regression models for real estate price prediction incorporating feature engineering, dummy variable encoding, and heteroscedasticity correction with weighted least squares.
- Conducted comprehensive regression diagnostics and influence analysis, including leverage (hat values), Cookโs distance, Breusch-Pagan test for heteroscedasticity, and robust standard error estimation (Whiteโs correction), improving model reliability and interpretability.
- Implemented prediction interval estimation for new observations using both standard and weighted models, demonstrating expertise in model evaluation, statistical inference, and advanced econometric techniques relevant to pricing, forecasting, and risk analysis.
Price_Prediction_with_Regression_Analysis/
โโโ notebooks/
โ โโโ Regression_Analysis_with.ipynb # Main walkthrough notebooks
| โโโ Regression_Analysis_with.R
โโโ data/
โ โโโ biele_WM_new.csv # Real-world dataset
โโโ scripts/
โ โโโ 1- Data_Preprocessing # Step-by-step analysis
โ โโโ 2- OLS_Estimation
โ โโโ 3- Hypothesis_Testing
โ โโโ 4- Model_Selection
โ โโโ 5- Problem_Analysis
โ โโโ 6- (back to) Model_Selection
โ โโโ 7- Model_Diagnosis
โ โโโ 8- Linearity
โ โโโ 9- Homoscedasticity
โ โโโ 10- Variance_Inflation_Factor
โ โโโ 11- Outlier_Analysis
โ โโโ 12- Leverage
โ โโโ 13- Cook's_Distance
โ โโโ 14- Heteroscedastic_Errors
โ โโโ 15- Breusch-Pagan_Test
โ โโโ 16- Two-Stage_Least_Squares
โ โโโ 17- White-Estimators
โ โโโ 18- Final_Model
โโโ README.md # Project overview (you are here)
โโโ LICENSE # MIT License
- Cleaned and validated the dataset for missing values.
- Transformed variables and prepared features for regression analysis.
- Implemented OLS estimation and calculated regression coefficients manually.
- Built an OLS regression model and interpreted coefficients, significance tests, and goodness-of-fit metrics.
- Validated manual results against built-in statistical outputs.
- Tested statistical significance of regression coefficients.
- Conducted t-tests and evaluated p-values.
- Assessed evidence for predictor effects on the response variable (F-Test).
- Compared alternative model specifications.
- Evaluated predictor relevance and model performance.
- Selected variables based on statistical and practical significance.
- Investigated potential issues affecting model validity.
- Assessed assumptions and data characteristics.
- Identified areas requiring further diagnostic analysis.
- Refined the model by removing or retaining predictors.
- Compared candidate models using performance metrics.
- Improved model interpretability and predictive quality.
- Evaluated overall model assumptions and fit.
- Analyzed residual behavior and model adequacy.
- Identified sources of bias or misspecification.
- Verified the linear relationship between predictors and response.
- Examined residual and fitted value plots.
- Assessed whether linear regression assumptions were satisfied.
- Checked for constant variance of residuals.
- Evaluated residual patterns across fitted values.
- Assessed suitability of standard OLS inference.
- Measured multicollinearity among predictors.
- Calculated VIF scores for each explanatory variable.
- Identified variables causing instability in coefficient estimates.
- Detected observations with unusual residual behavior.
- Evaluated the impact of extreme data points.
- Determined whether outliers should be investigated further.
- Identified observations with extreme predictor values.
- Assessed their potential influence on model estimates.
- Examined leverage statistics and influence measures.
- Measured the influence of individual observations.
- Identified points that substantially affected regression results.
- Evaluated robustness of model estimates.
- Investigated non-constant error variance.
- Analyzed residual dispersion patterns.
- Assessed implications for statistical inference.
- Performed a formal test for heteroscedasticity.
- Evaluated whether residual variance depended on predictors.
- Determined the validity of OLS standard errors.
- Addressed potential endogeneity issues.
- Implemented instrumental variable regression.
- Estimated consistent coefficients under endogenous predictors.
- Computed heteroscedasticity-robust standard errors.
- Improved inference when variance assumptions were violated.
- Compared robust and conventional statistical results.
- Constructed the final validated regression model.
- Incorporated diagnostic findings and model improvements.
- Presented the final estimates, inference, and conclusions.
- Python 3.12 and R 4.4.0
numpy,pandas,scipy,statsmodels,scikitlearn,seaborn,matplotlib- Jupyter Notebook, RStudio
- Regression Models, Methods and Applications by Ludwig Fahrmeir et al.
Feel free to reach out or star this repo!
Letโs learn together. ๐ฑ
