2
$\begingroup$

In my googling, it seems the proper way to find the median of a cdf of a discrete variable is to stick to the discrete values provided, even if you overshoot and end up with an x where P(X <= x) > 0.5. But is there a way to approximate an exact value such that P(X <= ) = 0.5?

A straightforward way would be to use the slope between the two points closest to 0.5 to find X. Would this be considered reasonable? If not, are there other methods that better account for the whole distribution instead of just looking at two points?

Edit: It has been made clear that a non-integer value wouldn't really make sense. However, for some context, I'm looking at how many users have converted after a certain number of free trial appointments, and how that number might be applied across many users. You can see why it feels weird to laypeople to say the median is 5 if P(X <= 4) = 0.49 but P(X <= 5) = 0.90. That's an exaggeration, but the kind of issue I face.

$\endgroup$
5
  • $\begingroup$ By a discrete variable, do you mean the values are $0$ and $1$? $\endgroup$ – Dave Jun 14 at 12:18
  • $\begingroup$ Apologies if I misused the term. I meant opposite of continuous? X can only take on discrete values, often integers $\endgroup$ – Nicholas Hassan Jun 14 at 12:27
  • $\begingroup$ Think of your question for a Poisson variable. The idea of $1.4$ or $6.7$ events as the median does not make sense to me. $\endgroup$ – Dave Jun 14 at 12:29
  • $\begingroup$ Yes I see it's not correct to do so. I made an edit in the original post for context though. Knowing this "exact median" value, one might be able to say they're willing to give out 100 appointments to 50 people, assuming 50% of them will convert - as an example $\endgroup$ – Nicholas Hassan Jun 14 at 12:50
  • 1
    $\begingroup$ @Dave If you had a Poisson distribution with parameter $\lambda = \log_e(2)\approx 0.693147$ then the median could be $0$ or $1$ or anywhere inbetween $\endgroup$ – Henry Jun 14 at 13:05
1
$\begingroup$

I don't think the whole approach is reasonable. What would be the point of getting the exact value of X and what would that value even mean? I think this simply does not apply to a cdf of a discrete variable. You should take the first X where P(X <= x) > 0.5, because only then you can be sure that half of the data points are behind it. If you try to estimate the exact X, for which it is 0.5, it is only an estimation, so you can't be sure it is right, and it does not bring much meaning.

Edit:

I guess if you really want to do this you could find a number or a fraction where X=x, for which the exact value of a cdf reaches 0.5 So as an example you have 10 observations where X=1 and 20 where X=2. You could figure out at how many X=2 you get the median, however because of numerical issues this wouldn't always work. If you had 13 X=1 and 20 X=2 you would again need to take the higher number and say that the median is at the 17th X=2, since saying it is 16.5 does not bring much meaning to a discrete cdf distribution.

$\endgroup$
2
  • $\begingroup$ I'm no statistician, just a consumer so I seek guidance on best practices but I also sometimes deviate to fit business purposes. In this particular case, I'm looking at how many users have converted after a certain number of free trial appointments, and how that number might be applied across many users. You can see why it feels weird to laypeople to say the median is 5 if P(X <= 4) = 0.49 but P(X <= 5) = 0.90. That's an exaggeration, but the kind of issue I face. $\endgroup$ – Nicholas Hassan Jun 14 at 12:40
  • $\begingroup$ If you are fine with the median having a fraction I would go for the approach I wrote in the edit. Say you have 41 observations of X=5 and 100 observations in total for simplicity sake. I would take as many observations as are needed to get to the median, so here 1, and divide it by the total observations of that X, here 41. Then adding that fraction to P(X=4) would be some reasonable estimate. You would come out with P(X<=4.024) = 0.5. If the step between Xs wouldn't be one like here, this fraction would have to be appropriately scaled. That said I would try and find a different approach. $\endgroup$ – Mateusz Jun 14 at 13:06
1
$\begingroup$

I do not think that this approach is reasonable. The cdf of a discrete random variable is a step function with jumps at the mass points, and if we would like to find a value $x$ such that $F_X(x) = 0.5$, in most cases we would not be able to do so. Therefore, the approach that you are proposing is not better or worse than just taking any random number between two closest values.

I see your problem, and I completely understand that this definition may lead to weird results. However, median in statistics and econometrics is a well-defined quantity that is also widely used outside of our field, so I would not recommend reinterpreting this quantity for a particular problem. Maybe, it makes sense to turn your attention to the mean instead of the median? I think it would provide a little better result in the context that you are describing (giving appointments to 100 people assuming certain number of them will convert).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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