Week 3 – Monday: Assessing Heteroskedasticity in Regression Analysis for the CDC dataset

This blog mainly provides the information about the heteroskedasticity in the statistical analysis. While analysing the data with three variables % Diabetic, % Obesity, and % Inactivity on the basis of the common factor i.e. FIPS. I came to conclusion that are significant evidence of heteroskedasticity is detected in the statistical analysis of the given data frames.

To achieve this, I have gone through the process of regression analysis by creating a linear regression model and make predictions while plotting them as a scatter plot. This note one can relate to my last blog where I successfully found the residuals (variance of the errors) against the predicted values (fitted values) in the regression model.

After that I performed the Breusch-Pagan test and extracted the test statistics and p-value to further move in the process for heteroskedasticity. While doing this process, I found the p-value which is equal to 3.555846910402045e-05 which is equal to 0.00003555846910402045 and the test statistics for Breusch-Pagan test is 20.48866439862667. I check whether the p-value is less than a significance level (e.g., 0.05) to determine if there’s significant evidence of heteroskedasticity. I came to result that the obtained p-value is extremely less than the significant value which leads to the information that the heteroskedasticity is found in the analysis of the linear regression model.

For this process I used the ‘statsmodel’ library which provides classes and functions for estimating and interpreting various statistical models. It’s commonly used for performing statistical analysis and regression modeling and ‘sm.OLS’ library which represents the Ordinary Least Square (OLS) regression model and the “least squares” part means that it minimises the sum of the squared differences (residuals) between the observed dependent variable (y) and the predicted values from the linear model.

 

Leave a Reply

Your email address will not be published. Required fields are marked *