# how to deal with heteroscedasticity in least squares regression with multiple independent variables

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. • Where did you get the idea that heteroscedasticity in the explanatory variable(s) should be of any concern ? Jun 12, 2021 at 14:58
• 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. Jun 12, 2021 at 15:18
• "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.) Jun 12, 2021 at 15:25
• 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. Jun 12, 2021 at 15:28
• 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. Jun 12, 2021 at 15:39