Modelling a percentge as a dependent variable

I have a dataset containing 4 variables:

1. Y - the dependent variable. This is a percentage of students in a school that choose to take an external exam. The values vary from 20% to 70%.
2. X - the independent variable. This is a binary variable with two groups: A and B.
3. M - A mediator variable.
4. W - A moderator variable.

As far as I know, it is not possible to use a linear regression model since the dependent variable is a percentage variable, which means that predictions of the model might exceed the values of 0 to 1. In addition, I understand that by using percentages, the relation is not linear.

I heard that the solution is to use a transformation, the arcsin of the square root of the dependent variable.

I have a few questions:

• Why is the arcsin of the square root the answer? Where is it coming from ?
• If I do it, how to I interpret the coefficient of the model? In other words, how do I make a reverse transformation ?
• Is there a better way to tackle this problem ? Someone mentioned a beta regression, is it an option?

• Do you know the numerator and denominator that comprise the percentage? If so you could use a something like binomial regression. – if_the_correlations_are_zero Jan 19 at 21:54
• Yes, I do know the numerator and denominator. There is a dependence between students within each school, so are you saying I will need a generalized linear mixed model with the binary link function ? – user3275222 Jan 19 at 21:57
• I guess you could treat the children as the unit and do binary logistic with school-level effects incorporated. Or you could do a binomial regression (for the total count) with an over/underdispersion correction, as over/underdispersion is often the result of dependence between binomial trials. – if_the_correlations_are_zero Jan 19 at 22:06

As far as I know, it is not possible to use a linear regression model since the dependent variable is a percentage variable, which means that predictions of the model might exceed the values of 0 to 1.

They might but given your closest observed proportion to either boundary is 0.2, I doubt that will happen unless you're predicting far outside the range of the data.

You also have potential issues with heteroskedasticity, skewness and discreteness.

The heteroskedasticity implied by a binomial proportion is relatively mild for your range of proportions; the ratio of largest to smallest standard deviation would be 1.25 (for proportions of 50% vs 20%). This won't cause big problems if you're not projecting outside the range of the data. If your counts are not small the skewness and discreteness at the p=0.2 case are not likely to trouble you either.

So although the linear regression model is incorrect (it always is), it's probably going to work quite well. [You can always use simulation to investigate behaviour in cases like yours]

In addition, I understand that by using percentages, the relation is not linear.

As proportions approach boundaries, it can't be (because any line that's not perfectly flat would cross a boundary. But your case appears to have only middling proportions. That doesn't mean the relationship will be linear, only that it is possible to be close enough to linear that you couldn't tell a practical difference anyway. Consider how close to linear a logistic function is in this middle region.

In particular, if you look at the population p's (not the noisy data, the actual population curve of expected values) from an exact binomial glm over that range, you can't really see deviation from linearity until you're below 0.25 or perhaps a tad less.

So - if your predictions are always between 0.2 and 0.7, that really doesn't appear to be much of an issue.

I heard that the solution is to use a transformation, the arcsin of the square root of the dependent variable.

That has to do with fixing the heteroskedasticity (non-constant variance), not the nonlinearity.

Specifically, in the case of a binomial proportion, the arcsin-square root is what's called a variance-stabilizing transformation, because it makes the variance approximately constant (it works better when the sample sizes aren't too small). It doesn't work with exact 0's or 1's.

While it isn't a linearizing transformation (for a logistic model that would be the $$\operatorname{logit}$$), as a side-effect it does somewhat improve linearity, at least in the range you're looking at; in particular it seems to reduce the curvature at the bottom of the above plot, making the whole section look almost straight.

As a further side effect, it also somewhat improves the normal approximation (that is, while a binomial is approximately normal for large n if you're not too close to the boundary, after this transformation the approximation is better). This is a convenient side effect, though it's not the same as the symmetrizing transformation (so if all you want is being close to normal, you can do better).

In other words, how do I make a reverse transformation ?

Invert the two components of the transformation one by one:

If $$z=\arcsin(\sqrt{p})$$ then (taking $$\sin$$ of both sides) $$\sin(z)=\sqrt{p}$$ and hence $$p=\sin^2(z)$$ (squaring both sides to isolate $$p$$).

Beware, however -- when you reverse a nonlinear transformation, you don't transform back to expected values on the original scale. If that's your aim you may want to consider whether you need an approximate unbiasing term (it depends what you're trying to achieve).

Someone mentioned a beta regression, is it an option?

For count proportions it wouldn't be my first thought (though it would probably work quite well, since it can emulate the mean and variance of a quasi-binomial with large-n as long as you don't stray really close to the boundary). The approaches being discussed in comments (such as a mixed binomial GLM or perhaps a quasi-binomial model, depending on your interest) would be the sorts of models I'd look to first (which exactly you choose depends on what you want to know and how you see your variables and so on).

But (for the reasons outlined in the earlier parts of my answer, if you fitted a plain old mixed linear model, it would probably work quite well, and could yield very similar predictions.

• The "plain old mixed linear model" also has the advantage that all your estimates are interpreted exactly in the original units of percentage. I always try every option for NOT transforming a dependent variable, unless it is absolutely necessary. I agree with Glen_b that yours looks likely to be a case where you can do alright staying in percentage units without transforming. – Brent Hutto Jan 20 at 1:24
• Yes; while just fitting a linear model is not my usual advice for count proportions (nor is transformation, usually), in this case the problems in doing so are likely to be quite small and interpretation may be easier. It may require some additional work to forestall critics who don't look closely enough to see that it will hardly matter, but it's a reasonable approach. One might also compare results from an untransformed linear model, a transformed one and say a quasi-binomial model. The fits should be almost identical but the raw coefficients will differ (& with some movement in p-values) – Glen_b Jan 20 at 1:35
• Thank you guys. I tend to accept what you say. Two points that I would like to clear out. You said that the reverse transformation doesn't go back to original units (arscin). If I wanted to interpret the coefficient of the regression, in this case the difference between the groups, how can I do that then ? Secondly, you mentioned a simple mixed model (and not a binomial one). If I use a simple mixed model on the percentages, I have no clusters, why is it better than a simple regression? Another advantage of simple regression is testing the mediation and moderation. – user3275222 Jan 20 at 6:27
• 1. "You said that the reverse transformation doesn't go back to original units" -- no, I definitely didn't say that! It goes back to original units just fine. The problem is expected values don't transform to expected values. So if you are getting unbiased estimates of expected values on the transformed scale you won't get the same after you transform back (at least not directly). In some cases this is a problem but in many cases it's not an issue – Glen_b Jan 20 at 6:33
• .... 2. on the mixed model thing -- your model is completely your choice; it looked to me like a situation you'd use mixed models in, but if you don't want a mixed model then don't use one! – Glen_b Jan 20 at 6:36