Brian Abbott Posted May 4 Share Posted May 4 When working with a box plot or violin chart. The Q3 result is different to what I get in excel and chat gpt. Using simple values as an example. 3 , 4 , 5 , 5 , 7, 8 , 9 , 10 , 11 , 11, 12. Q3 in excel = 11 Spotfire = 10.5 from chat gpt Median (Q2): The dataset has an odd number of values, so the median is the middle value. Median (Q2) = 8 (the 6th value in the sorted dataset) First Quartile (Q1): Counting from the start, Q1 is the median of the first half of the dataset. Q1 = median of (3, 4, 5, 5, 7) = 5 (the 3rd value in the sorted dataset) Third Quartile (Q3): Counting from the end, Q3 is the median of the second half of the dataset. Q3 = median of (9, 10, 11, 11, 12) = 11 (the 4th value in the sorted dataset) So, for the given dataset, the median (Q2) is 8, the first quartile (Q1) is 5, and the third quartile (Q3) is 11. Link to comment Share on other sites More sharing options...
Solution Andrew Berridge Posted May 4 Solution Share Posted May 4 Hi Brian, Great question! As it happens, there are many different methods to calculate the quartiles. Take a look at this Wikipedia page. There are at least 4 standard methods for calculating them: https://en.wikipedia.org/wiki/Quartile R can use one of 9 different methods... Spotfire, and the Violin Mod use the type 7 method here: https://www.rdocumentation.org/packages/stats/versions/3.6.2/topics/quantile This is the default for R, and if it's good enough for R, I would say it's good enough for Spotfire. However, if you absolutely NEED it to match Excel, then I could consider implementing the Excel-type calculations for the Violin Mod, as an option. Let me know in a reply! Thanks, Andrew (Violin Mod author, Spotfire Field Tech Team) Link to comment Share on other sites More sharing options...
Brian Abbott Posted May 4 Author Share Posted May 4 Hello Andrew Thank you for the reply and for the link to the explanation. Thanks for the offer to alter the mod to match excel, however now that I have an understanding of how it is calculated it is all good as I will be able to explain it in the visualization. Cheers Brian 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now