# Biostats two way anova in R boxplot visualisation

I am having a problem analyzing some data from a recent experiment in R.

The experiment was balanced with 5 replicates in each group. It included two factors (plant type and leaf age) with 15 combinations (5 plant types x 3 age classes within each plant type).

I arranged the data in long form and conducted a two way ANOVA in R. The main effects were separately significant, but the interaction of both was not.

Now I am unsure what my next steps are.

I want to display my results in boxplots showing which plant types have significant differences, and which leaf ages are significantly different?

• Welcome to our site. Your question is unclear: are you asking whether boxplots would be useful or are you asking how to produce those boxplots? – whuber Feb 24 '19 at 16:51
• Box plots are typically based on medians and quartiles. ANOVA is based on means and variances or SDs. Looking at the data with boxplots might well help you understand the ANOVA, but the pertinence is indirect. – Nick Cox Feb 24 '19 at 16:56
• Thank you for your reply! Sorry I was not clear. The issue isn't drawing the box plots. I generated those fine. What I cannot seem to do is to determine the significance of each set (and therefore box) in relation to the group. In the example I have, the significance of the set is indicated as a '*' above each box as an annotation. – L.E Feb 24 '19 at 16:58
• The title and question are not clear then. You emphasised box plot visuallzation in your title and closed with "I want to display my results in box plots". Please consider rewriting the title and text to focus on what you want to know. – Nick Cox Feb 26 '19 at 9:21

You should try the predictmeans::predictmeans() function - this will take the fitted model and produce graphs with least significant difference bars which will clearly show which groups are different from one another. The function also allows you to chose a method for correcting when conducting multiple comparisons.
• No worries. Personally, I typically avoid ANOVAs altogether as they have a strict set of assumptions that are rarely met, and don't usually handle complex designs well. Instead I would recommend a mixed-effects model - you can fit these with the lme4 package and they are compatible with the predictmeans function. What does your data look like? Are group sizes equal? Is your data normally distributed? How would you nest? Sorry for all the questions but I can't offer more guidance without understanding your data. – André.B Feb 25 '19 at 22:21