# Using WLS vs making the residuals homoscedastic to fit OLS regression

I'm convinced that homoscedasticity (of errors) is not an assumption (at least not explicit) for OLS regression. Also, even though WLS is advocated for heteroscedastic errors, OLS is not particularly bad, at least when the heteroscedasticity is limited as has been discussed by Gung in his answer. However, let's say that I encounter, while fitting an OLS using a feature X and an outcome variable y, heteroscedastic errors and go on to transform the variables, say using log transformation on both - X and y - and thus be able to beget fairly homoscedastic errors. Should I now give the results of OLS credence? Is it even a good practice? Or should I use WLS regression instead?

------------------------------------------------------------------------------------------------------------

EDIT:

Earlier I took X and y for integer counts.

• Hi @Ritik. To my knowledge, if you have count data - OLS is misspecified. There are count data based models designed for dealing with heteroskedasticity. Mar 7, 2022 at 16:34
• If your outcome variable is an integer count you probably should be using a generalized linear model appropriate to counts instead of OLS/WLS: Poisson, quasi-Poisson, negative binomial.
– EdM
Mar 7, 2022 at 16:34
• Thank you, didn't consider that while writing the question, I have edited it Mar 7, 2022 at 16:38

Homoscedasticity is an assumption for the optimality of OLS (i.e., that it is the best linear unbiased estimator of model coefficients) and an assumption for the validity of the usual OLS standard errors.

It is important to note that a model fit using the original features and outc some and a model fit using transformed features and outcome are different models that make different assumptions about the relationship between the features and outcome. The coefficients in one model do not mean the same thing as the coefficients in the other model. The concept of homoscedasticity depends on the specific model used because the errors result from that model. Your first question should be, which model best captures the relationship between the features and the outcome?, or which model allows me to estimate the specific quantity I want to estimate? How to estimate the standard errors comes secondary and is a response to this question.

If your transformed model is the better model (in the sense that it captures the relationship you are after better), then use it, and if the assumption of homoscedasticity of errors is met with this model, then use that assumption. It may still be a good idea to use a robust standard error. As some in the comments have noted, there may be models better than OLS on the transformed variables that suits the data better, like as count models for integer data, such as the (quasi-)Poisson model.

• Thank you @Noah. I wish to point out a few things; 1) I know that the coefficients in one model do not mean the same thing as the coefficient in the other. 2) Couldn't the variability be examined by comparing X against y? In that sense, heteroscedasticity could be examined before employing a model. 3) The question remains, having removed the heteroscedasticity to a huge extent by transforming the data, whether OLS could be preferred over WLS or not? Assume that the variables both before and after transformation are continuous. Mar 7, 2022 at 16:49
• @RitikP.Nayak Heteroscedasticity is of the errors, and errors result from a specific model. Some models will exhibit heteroscedasticity and some won't even when fit to the same data. Indeed, this is exactly the situation you are in. There is no heteroscedasticity "before and after" transforming the data; there is heteroscedasticity with the original model and maybe not with the second model. Whether there was heteroscedasticity in the first model has nothing to do with whether there is (and how it should be dealt with) in the second model; they are different models.
– Noah
Mar 7, 2022 at 17:20
• @RitikP.Nayak so if you are going to use a model on transformed data, it doesn't matter what occurred with the un-transformed data. Transforming data is the same as applying a specific model. If there is heteroscedasticity in a model, address it how you see fit. My preference is to use OLS with robust standard errors if all you care about are the regression coefficients.
– Noah
Mar 7, 2022 at 17:22
• Thank you @Noah, you have 'largely' answered my question. I have upvoted it. I would but like to seek one clarification though. Could you please elaborate your statement; "If your transformed model is the better model (in the sense that it captures the relationship you are after better), then use it, and if the assumption of homoscedasticity of errors is met with this model, then use that assumption." Mar 8, 2022 at 2:20
• @RitikP.Nayak Your choice of model should typically be that which represents the relationship you are seeking to describe best. If the relationship is best described by the transformed variable, then you should use the transformed variable. Independently of that, and independently of whether the was heteroscedasticity with some other model fit to the same data, you can evaluate whether heteroscedasticity is a problem in the present model and deal with it how you like. If there is none, then you don't have to deal with it.
– Noah
Mar 8, 2022 at 6:14