I have dataset designed around a whiskey tasting. I have 25 tasters who have submitted scores on about 20 whiskeys. Here is a sample of how I structured the data in Mathematica:
tasting = {<|"sample" -> "KC120", "score" -> 70, "taster" -> "MattW"|>, <|"sample" -> "SazRye", "score" -> 70, "taster" -> "Sky"|>, <|"sample" -> "OF", "score" -> 72, "taster" -> "EdB"|>, <|"sample" -> "BT1", "score" -> 73, "taster" -> "Leif"|>, <|"sample" -> "4RSB1", "score" -> 74, "taster" -> "MattW"|>}
I want to run some analysis on the different samples to see how well they were received. I am particularly interested in seeing how many of the scores for each samples were over 85 points. It is a bit tricky because not every taster submitted results for each sample.
I can count how many scores were over 85 with the following code:
over85 = tasting[Select[#score > 85 &], "sample"][Counts]
And I can figure out how many scores were submitted with this:
totalscores = tasting[Counts, "sample"]
Here is where I am running into problems. I want to divide the number of samples that were over 85 by the total number of scores submitted for each sample and have it return a percentage for each sample.
I tried simply running:
over85/totalscores
But, all I got was a table over a table instead of the calculations being run for each sample.
Any ideas on how to run the calcs and return the results grouped by sample?
Thanks in advance!



