Logistic regression for a continuous dependent variable

I am trying to model a response variable, the weight of a variable (can't be thought of a binomial distribution as it involves no success/failures), that falls between 0 and 1. That is, the response variable always has to lie between 0 and 1. Here are my alternatives:

1. Do a logit transformation of the response variable and fit a linear regression:

$${\rm logit}(Y) \sim β_0 + β_1X_1 + \ldots$$

2. GLM with a logit link function

What is the difference between the two approaches? In this case, the predictive accuracy of the model is more important than the interpretability of the variables.

• This is purely about programming, so I'm voting to close. This forum is not an R help line, there are dedicated places for that. – Matthew Drury Jun 15 '17 at 17:37
• Could you ignore the programming part of the question? – redwing21 Jun 15 '17 at 17:45
• That seems to be your whole question... I would edit it to make your intention more clear. – Matthew Drury Jun 15 '17 at 17:48
• Why do you need to use a logit? What about beta regression? – kjetil b halvorsen Jun 15 '17 at 18:00
• The distinction you are making isn't sufficiently specific to yield a definite answer: could you state how you would "fit a linear regression" in the first alternative? – whuber Jun 15 '17 at 19:39

Your first option could work. It assumes that the residuals from the model on the transformed data are normally distributed. You need to check this. If it's true, you will be OK.

Option 2 depends on how you set up the GLM. Simply using a logit link function does not necessitate that you use any particular response distribution. Certainly, the logit link is most commonly used with a binomial distribution, but it doesn't need to be. I assume you are thinking about something like using a normal distribution for the response with a logit link. If so, that probably wouldn't be a great choice, as the normal distribution assumes the data are unbounded, but yours are not. For example, the positive residuals you could have could only exist in the interval $(1-\hat\mu,\ 0)$, whereas the negative residuals could only exist in $(0,\ 0-\hat\mu)$; it is very likely you would have heteroscedastic residuals with differing skews. Even if not, they could not possibly be normal. The effect that will have on the predictive ability of the model is unclear to me, but I just wouldn't go this route.

My guess is that your best be may be to use Beta regression. The Beta distribution is very flexible and should typically be the best choice for continuous proportions. Note however, that it is possible to have data bounded by 0 and 1 that do not fit any Beta distribution, so you again need to check if it's sensible.

• I didn't follow all of this. When a variable ranging between $0$ and $1$ is subjected to a logistic transformation, it is potentially unbounded above and below. Whence, then, comes the objection to a Normal distribution for the response? – whuber Jun 19 '17 at 17:53
• @whuber, are you referring to the discussion of option 2? If you have data that are bounded by 0 & 1 and fit a GLM w/ a logit link & a normal response, you are not transforming the data, only the mean. Did I misinterpret your question? – gung Jun 19 '17 at 18:42
• No, I think I must have misinterpreted the answer. It's certainly a wacky situation: the logit link predicts some real value $\hat\mu$, but relative to that real value the actual response in the data can take only the two values $1-\hat\mu$ and $0-\hat\mu$. It is that behavior, not unboundedness, that so clearly militates against a Normal (or practically any other) distributional form for the response! – whuber Jun 19 '17 at 18:53
• @whuber, I tried to clarify the issue. See if you think it helped. – gung Jun 19 '17 at 19:01

Your idea is to use the logit (I call it $f$ to make clear that what $f$ is does not matter in what I will explain) in order to fall between 0 and 1. This idea of yours is not especially related to logistic regression. It is similar to using a log link function in order to deal with a positive $Y$.

So the difference between model 1 and model 2 is the same as if you used a log. The first is transformed linear regression, the second is GLM. The key difference is :

• Transformed : $E(f(Y)|X)=\beta X$
• GLM : $f(E(Y|X))=\beta X$

What is best ?

It depends on what you want. One of the problems with transformed linear regression is explained here (with log): http://davegiles.blogspot.fr/2013/08/forecasting-from-log-linear-regressions.html. If this bias on the mean is a true problem for you then GLM solves this problem.

Otherwise transformed linear regression would more natural (see gung's answer).

The difference between the two models you've described is that the first supposes that the DV is a continuous variable that varies between 0 and 1, whereas the second (usually called "logistic regression") supposes that the DV is a discrete variable that can take only the values 0 and 1. So the second one is inappropriate for your case.

• Does it necessarily follow that the second approach must be logistic regression? My understanding was that GLMs worked when you have a distribution from the exponential family, so is there a reason it couldn't be done with a Beta distribution? Ad facie it seems plausible since people do Gamma GLMs. – neverKnowsBest Jun 16 '17 at 0:01
• @neverKnowsBest I'm not sure. I know that beta regression is a thing that is done, but not whether it's a GLM or how it compares to OP's first alternative. – Kodiologist Jun 16 '17 at 0:05
• The second model is not logistic regression (the way the question was asked). It is just GLM with a logit link on a continuous variable. – Benoit Sanchez Jun 19 '17 at 19:16
• But the expression was in the title, sorry I hadn't seen it. Confusing... – Benoit Sanchez Jun 19 '17 at 19:26