Check linear regression residuals are normally distributed with olsrr package in R.

Packages we will need: One core assumption of linear regression analysis is that the residuals of the regression are normally distributed. When the normality assumption is violated, interpretation and inferences may not be reliable or not at all valid. So it is important we check this assumption is not violated. As well residuals being normal distributed, we must also check that the residuals have the … Continue reading Check linear regression residuals are normally distributed with olsrr package in R.

Check for multicollinearity with the car package in R

Packages we will need: When one independent variable is highly correlated with another independent variable (or with a combination of independent variables), the marginal contribution of that independent variable is influenced by other predictor variables in the model. And so, as a result: Estimates for regression coefficients of the independent variables can be unreliable. Tests of significance for regression coefficients can be misleading. To check for multicollinearity … Continue reading Check for multicollinearity with the car package in R

Correct for heteroskedasticity in OLS with sandwich package in R

Packages we will need: If our OLS model demonstrates high level of heteroskedasticity (i.e. when the error term of our model is not randomly distributed across observations and there is a discernible pattern in the error variance), we run into problems. Why? Because this means OLS will use sub-optimal¬†estimators based on incorrect assumptions and the standard errors computed using these flawed least square estimators are … Continue reading Correct for heteroskedasticity in OLS with sandwich package in R