# Dealing with violation of OLS assumptions

I am currently writing my Master's thesis in economics. I am analyzing the second home rate in Swiss municipalities in R.

The second home rate for municipality $$j$$ is defined as the share of the residential housing in the municipality used as second home.

For example the observation for municipality Bern has totally 1000 flats, where 100 flats are used as second home. So the dependent variable "second home rate" has the value 100/1000 = 0.1.

I have 30 independent variables (2 dummy variables and the rest are numeric variables). My goal is to find out which of these variables have a significant effect on the second home rate. I used the lm function including all my variables (without any transformation or any interaction terms). Then I used regsubsets to get the best model by the BIC criterion.

So far so good, but then I began to test the OLS assumptions. I got significant results for the Breusch Pagan test (to test homoscedasticity), for the raintest (to test linearity) and for the reset test (to test model specification). This means there is violation of the linearity assumption, normal distribution of residuals assumption and the homoscedasticity assumption.

Now there are two possibilities: either I transform variables or I use for example glm. Honestly I would like to work with OLS, so I need to transform variables. But how do I know which variables I need to transform? And which transformation they need? Do I need to consider all 30 independent variables for transformation?

I know there is the function powertransform or I used histograms of every variables to detect the transformation. But this way didn't work well. Does anyone have a good suggestion for me? Maybe I didn't use the powertransform function in the right way.

Here are the plots I get out of lm function:

And here some Component + Residual plots for some variables. The problem of heteroscedasticity is clearly obvious.

I hope my explanation is fine. If not let me know and I will give some further information.

• First of all you need to define the dependent variable when you introduce your problem. What exactly is the second home rate? Is it the percentage of housing units that are second, is it the percentage of households in a municipality that owns a second home? If you want to apply economic theory to variable selection rather than dubious statistical criteria this is certainly first step. May 2, 2020 at 10:25
• Thank you Jesper for President. Sorry my dependent variable is the percentage of second homes in a municipality. For example the observation for municipality Bern has totally 1000 flats, where 100 flats are used as second home. So the dependent variable "second home rate" has the value 100/1000 = 0.1. I hope now it's clearer. May 2, 2020 at 11:21
• It is much clearer thank you. Put that into the question itself (which I did for you this time). May 2, 2020 at 14:09
• Your response variable is tightly constrained to $[0,1]$, so you’re going to violate some standard assumptions of OLS, chiefly normal residuals. The distributions of your predictors is not important, unless you lack a linear relationship between the predictor and the response (e.g. the response depends on $log(income)$ instead of just $incone$). But there’s no normality assumption on the predictors like is typical about the error term.
– Dave
May 2, 2020 at 14:22
• It would be nice to know sample size (how many municipalities are there). Also do you have observation over time or is it a cross-section. Also you need to provide some meaningful summary of the 30 independent variables. May 2, 2020 at 14:31

As much as you "would like to work with OLS," that won't really be reliable with this type of study. Your very first plot of residuals versus fitted shows pretty much you would expect for a model with binary outcomes: high variance near p = 0.5, small variance at the extremes. Sometime a linear probability model can work adequately if the probabilities cover only a small range, but yours seem to cover the entire range from 0 to 1 (depending on the values of your predictor variables).

What you seem to be seeking (in part) is a transformation of your outcome variable that will spread out the variance at the extremes of the probability scale relative to the middle. But that's pretty much just what the logistic and probit models do, while accounting properly for the error terms expected from the underlying model assumptions. See this page for further discussion about the limitations of the linear probability model and the choice between logistic and probit.

There is a method of handling probability outcomes related to OLS, called sequential least squares, explained in this answer. But it is far from OLS in practice, still has to deal with heteroscedasticity, and it's not clear to me what advantages it provides over standard logistic or probit regression.

You also could model this with a Poisson regression, using for each municipality the number of second homes as the outcome and the total number of homes an offset, but then again you have a glm. (It's not clear from your explanation whether or how you are weighting municipality size in your model.)

However you proceed you will probably still face some non-linearities with respect to the modeling of your continuous predictor variables, but those can be handled with specific transformations or splines as for any regression.

So make the move toward some generalized linear model. That should be an important part of the training for any masters-level economist, so it will be good experience.