Cross Validated is a question and answer site for people interested in statistics, machine learning, data analysis, data mining, and data visualization. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some data in [0,1] which I would like to analyze with a beta regression. Of course something needs to be done to accommodate the 0,1 values. I dislike modifying data to fit a model. also I don't believe that zero and 1 inflation is a good idea because I believe in this case one should consider the 0's to be very small positive values (but I don't want to say exactly what value is appropriate. A reasonable choice I believe would be to pick small values like .001 and .999 and to fit the model using the cumulative dist for the beta. So for observations y_i the log likelihood LL_iwould be

 if  y_i < .001   LL+=log(cumd_beta(.001))
 else if y_i>.999  LL+=log(1.0-cum_beta(.999))
 else LL+=log(beta_density(y_i))

What I like about this model is that if the beta regression model is valid this model is also valid, but it removes a bit of the sensitivity to the extreme values. However this seems to be such a natural approach that I wonder why I don't find any obvious references in the literature. So my question is instead of modifying the data, why not modify the model. Modifying the data biases the results (based on the assumption that the original model is valid), whereas modifying the model by binnning the extreme values does not bias the results.

Maybe there is a problem I am overlooking?

share|improve this question
It isn't really possible to give a good answer to this question without knowing more about the particular problem. The key question is whether the exact zeros and ones are generated by a different process to that which generates the data in (0,1). A classic example is rainfall, where there are exact zeros reflecting days where it doesn't rain. In your application are zeros and ones "special" in some way? – Dikran Marsupial Oct 10 '12 at 11:31

According to this paper, an appropriate transformation is

$$ x' = \frac{x(N-1) + s}{N} $$

"where N is the sample size and s is a constant between 0 and 1. From a Bayesian standpoint, s acts as if we are taking a prior into account. A reasonable choice for s would be .5."

This will squeeze data that lies in $[0,1]$ to be in $(0,1)$. The above quote, and a mathematical reason of the transformation is available in the paper's supplementary notes.

share|improve this answer
+1 .. But could you fix the first link or at least cite the paper so we can find it independently? – whuber Jun 28 '12 at 21:19
Thanks. Fixed now. – Cam.Davidson.Pilon Jun 28 '12 at 21:27
But that does not answer my question. I am well aware that one can transform the data. My questions is why not transform the model instead? – dave fournier Jun 29 '12 at 13:00
Dave, then please edit your question to reflect this: currently, it reads as if you are looking for a way to transform the data. In the process it would help for you to indicate what you think the difference is between a data transformation and a change of model, because if there is one, it is subtle. – whuber Jun 29 '12 at 13:23
@davefournier, If you read the paper Cam sites it in part addresses your question. They also give alternate model recommendations (see page 69), and part of the recommendations hinge on the nature of the data. Your adjusted likelihood looks like the "mixed discrete-continous process" (mentioned towards the end of page 69). It may also be the case the Tobit model will be satisfactory given your data, although it would be best to see other references for the appropriateness of the Tobit model, like Scott Long's book on categorical regression. – Andy W Jun 29 '12 at 15:43

The beta distribution follows from the sufficient statistics $(\log(x), \log(1-x))$. Do those statistics make sense for your data? If you have so many zeros and ones, then it seems doubtful that they do, and you might consider not using a beta distribution at all.

If you were to choose the sufficient statistic $x$ instead (over your bounded support), then I believe you end up with a truncated exponential distribution, and with $(x,x^2)$ a truncated normal distribution.

I believe that both are easily estimated in a Bayesian way as they are both exponential families. This is a modification of the model as you were hoping.

share|improve this answer


A common approach to this problem is to fit 2 logistic regression models to predict whether a case is 0 or 1. Then, a beta regression is used for those in the range (0,1).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.