# Extract cell means from ANOVA result and plot them

Is it possible to extract the cell means from an ANOVA result so one can plot them? I can extract the cell means using Part but I am not able to plot that information using ListPlot. Any suggestions would be greatly appreciated.

Use the following as an example...

Needs["ANOVA"];
ANOVA[{
{1, 1, 2}, {1, 1, 3}, {1, 2, 4}, {1, 2, 3},
{2, 1, 5}, {2, 1, 4}, {2, 2, 4}, {2, 2, 2}}
}, {x, y}, {x, y}]

• Can you provide some sample code to see what you are dealing with specifically? – MarcoB Oct 1 '15 at 2:21
• Will that work? – Steven Anderson Oct 1 '15 at 3:07

Needs["ANOVA"]

anovaresults =
ANOVA[{{1, 1, 2}, {1, 1, 3}, {1, 2, 4}, {1, 2, 3}, {2, 1, 5}, {2, 1, 4}, {2, 2, 4}, {2, 2, 2}}, {x, y}, {x, y}];


To plot all of them:

ListPlot[anovaresults[[2, 2, 1, All, 2]]]


... or only the ones corresponding to x[1], x[2], y[1], y[2]:

ListPlot[anovaresults[[2, 2, 1, 2 ;;, 2]]]


• This is awesome. thank you. I got to the [2,2,1] level but didn't know how to "drill" down to the actual values like you did. – Steven Anderson Oct 1 '15 at 5:42
• @StevenAnderson Glad it helps! Thanks for the accept as well. – MarcoB Oct 1 '15 at 5:50
• @StevenAnderson Also, note that you can get the list of CellMeans for further manipulations by First[CellMeans /.ANOVA[...]]. – yohbs Oct 1 '15 at 10:20
• @yohbs - thank you. – Steven Anderson Oct 2 '15 at 0:37