9
$\begingroup$

I'm just studying my statistics exams and I came across something odd.

When I try to get the 25th or 75th percentile with wolfram alpha, it gives me another answer than I should get according to my textbooks.

simple example: http://www.wolframalpha.com/input/?i=first+quartile+32%2C42%2C46%2C46%2C54

according to my textbook, the answer should actually be 37 and not 39.5

Does anyone have any idea what wolfram alpha does different?

$\endgroup$
1

1 Answer 1

14
$\begingroup$

There are at least 9 different definitions of empirical quantiles, see for example Wikipedia or the R manual (i.e., ?quantile).

R computes the 25th percentile of your data as 37 if you specify type = 6 (like Minitab and SPSS) and 39.5 if you specify type = 5 (piecewise linear function):

quantile(x = c(32, 42, 46, 46, 54), probs = 0.25, type = 5)
#  25%
# 39.5
quantile(x = c(32, 42, 46, 46, 54), probs = 0.25, type = 6)
#  25%
# 37
$\endgroup$
1
  • 2
    $\begingroup$ By default, R chooses type=7 to give a 25th percentile of 42 $\endgroup$
    – Henry
    Commented Aug 7, 2020 at 8:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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