I am trying to build a least-squares regression model and when I analyzed the independent variables, I saw a case of heteroscedasticity in one of the independent variables.

I'm building this model in python and I've thought of using weighted linear least squares instead of ordinary least squares regression. However, because I have more than 1 explanatory variable and statsmodel WLS works for 1 variable, I couldn't find a healthy way to implement it. Then, I tried to transform the data using log-transformation and square root and cubic root transformation, but most of the data is centered around 0. Therefore, these transformations were not helpful in my case as well.

so I was wondering what else I can try and what would work.

This was the residual plot for the independent variable with heteroscedasticity and response variable.

  • 2
    $\begingroup$ Where did you get the idea that heteroscedasticity in the explanatory variable(s) should be of any concern ? $\endgroup$ Jun 12, 2021 at 14:58
  • $\begingroup$ Because no heteroscedasticity is one of the assumptions of ordinary least square regression. "OLS Assumption 5: The error term has a constant variance (no heteroscedasticity)" This phrase is directly taken from a credible resource. $\endgroup$ Jun 12, 2021 at 15:18
  • 5
    $\begingroup$ "the error term". Indeed. But your question is about an independent variable not the error (which we never observe, hence we inspect the residuals.Please refer to my answer.) $\endgroup$ Jun 12, 2021 at 15:25
  • $\begingroup$ The graph I've provided is the residual plot. I'm sorry if I understood you wrong but you're saying that we would inspect residual plot, which is the graph I've provided. $\endgroup$ Jun 12, 2021 at 15:28
  • $\begingroup$ The question title literally says "heteroscedasticity in one of the independent variables". As I have mentioned in my answer, there is no requirement, assumption or condition concerning the distribution of the independent variables in a regression model. Moreover, the text before the plot literally says "The X-axis is my independent variable and the y-axis is the response variable". The residuals are the differences between the fitted values and the observed values - and it's these that you need to plot to assess heteroskedasticity. $\endgroup$ Jun 12, 2021 at 15:39

1 Answer 1


heteroscedasticity in one of the independent variables

There is no requirement, assumption or condition concerning the distribution of the explanatory (independent) variables in a regression model. We might like the conditional distribution of the response (conditional on the explanatory variables) to be approximately normal and without heteroscedasticity, and for that we would normally inspect the residuals.

  • $\begingroup$ Does this answer your question ? If so please consider marking it as the accepted answer. If not, please let us know why. Also, if you haven't already, please consider upvoting it. $\endgroup$ Jun 26, 2021 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.