If i have this sorted data:
$1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10$
They are 25 numbers.
How should I calculate the quartiles and percentiles?
I try this:
$Q_2 = 2 * \frac{25}{4} = 12.5$
$Q_1 = 1 * \frac{25}{4} = 6.25$
$P_{50} = 50 * 25/100 = 12.5$
Well, but what should I do when it is decimal, for non-clustered data? In some part I have seen,
approach the nearest larger whole.
So, $12.5 \rightarrow 13$
So, $6.25 \rightarrow 7$
In other places I read:
the value will be the average between the data that is at the left of the position with the data on the right.
So, What should I really do?
You are mixing the percentages with your actual numbers.
Note that for $Q_1$ you want to pick a number from your set such that 25% of your data is less than or equal to that number.
With your data {1, 2, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 8, 8, 8, 9, 9, 10, 10}
The $ Q_2 = 2 * \frac{25}{4} = 12.5 $% has no problem because it is $6$ with no confusion.
The$ Q_1 = 1 * \frac{25}{4} = 6.25$% should be $4$ because you want $ 6.25$% of your data less than or equal to $ Q_1$