Statistics 1ap quartiles - Printable Version +- HP Prime Forum (http://forum.hp-prime.de) +-- Forum: HP Prime (/forumdisplay.php?fid=1) +--- Forum: Questions to HP (/forumdisplay.php?fid=3) +--- Thread: Statistics 1ap quartiles (/showthread.php?tid=19) Statistics 1ap quartiles - Joe Rat - 24-09-2015 01:13 AM I have detected a bug in the Statistics 1App of the HP Prime Calculator. The bug affects the calculation of the first and third Quartile in case where the number of data points is EVEN: Let us take a simple example of the following data set: n Value 1 1.1 2 2.7 3 3.2 4 3.5 5 4.6 6 5.5 7 6.4 8 6.7 9 8.4 10 9.3 Measures of position First quartile (Q1) Every group of data has three quartiles. If you sort the data from smallest to largest, the first 25% of the data is less than or equal to the first quartile. To calculate quartiles, first order the data from smallest to largest. The first quartile (Q1) is the observation at position (N + 1) / 4, where N is the number of nonmissing observations. If the position is not an integer, interpolation is used. For example, suppose N=10. Then (10 + 1)/4 = 2.75, and Q1 is between the second and third observations (call them x(2) and x(3)), one-fourth of the way up. Thus, Q1 = x(2) + 0.75(x(3) - x(2)). In our example: 2.7 + 0.75 * (3.2 - 2.7) = 3.075 and NOT 3.2 as the calculator suggests Third quartile (Q3) Every group of data has three quartiles. If you sort the data from smallest to largest, the first 75% of the data is less than or equal to the third quartile and 25% of the data is greater than or equal to the third quartile. To calculate quartiles, first order the data from smallest to largest. The third quartile (Q3) is the observation at position 3(N + 1) / 4, where N is the number of nonmissing observations. If the position is not an integer, interpolation is used. For example, suppose N=10. Then 3(10 + 1)/4 = 8.25, Q3 = x(8) + 0.25(x(9) - x(8)), where x(8) and x(9) are the eighth and ninth observations. In our example: 6.7 + 0.25 * (8.4 - 6.7) = 7.175 and NOT 6.7 as the calculator suggests This means that if one calculates the interquartile range for a set of data where n is EVEN, this will also be wrong. AND the Box & Whisker plot for these data will also be wrong, as indeed it is! I also found, up to now, five HP Prime commands that do quite produce the result that the Help file promises... When I finish the program the calculates the TRUE quartiles as well as the Skewness and Kurtosis I shall flog this online. Remember: never take a statement at face value and: "Nothing elevates the Spirit more than striving for perfection." Bye for nowhttp://www.cg.ensmp.fr/bibliotheque/cgi-bin/public/bibli_index.cg, from, RE: Statistics 1ap quartiles - w_w - 24-09-2015 02:15 PM Sorry, I disagree. Is I know, for Q1 and Q3 no Interpolation is used. best regards Wolfgang RE: Statistics 1ap quartiles - Joe Rat - 25-09-2015 12:40 AM Amazingly enough verifying with the statistics program Minitab, Quartile 1 and 3 does not yield the same result as the Prime. Manual calculation does however yield the same result as Minitab. Please note that EVEN numbered data series give this problem. RE: Statistics 1ap quartiles - JMB - 03-01-2016 07:04 PM According to the website MathWorld, it looks like there is no consensus on how to calculate Q1 and Q3. Five methods ares listed there, four of them use interpolation and one does not (Mendenhall and Sincich). The answer given by the calculator Q1=3.2 and Q3=6.7, is in agreement with this last method.