# 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. – Jesper for President May 2 '20 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. – Beat Johner May 2 '20 at 11:21
• It is much clearer thank you. Put that into the question itself (which I did for you this time). – Jesper for President May 2 '20 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 '20 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. – Jesper for President May 2 '20 at 14:31

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.)