When there are 3 predictor variables to consider, what is the correct procedure?

Do we make box plots for all the possible 2 combinations or is there a way to compare 3 variables?

Sorry if this is a basic question.

The response is uranium response and there are 3 predictor variables: time, temp, and acid strength. All 3 predictor variables have 3 levels, low, medium, high. I would like to try to run a 3-way ANOVA analysis on the data set, it's an exercise question for a class, but not too sure how to start, so I'm using box plots to see how the data looks like first.

  • 1
    $\begingroup$ Need to know i) analysis you're trying to run, ii) what are the nature of the three variables, and iii) what exactly are you trying to test/show with the box plot. $\endgroup$ Sep 19, 2013 at 2:42

3 Answers 3


Thanks for the clarification. You can capitalize on the paneling and clustering designs and put together a compact boxplot like this:

enter image description here

The boxplot will be useful for assessing group-wise distribution and outliers. However, since it's an ANOVA, I'd also recommend visualize the mean and 95% CI as well using error plot:

enter image description here

By comparing and contrasting the positions of each mean and CI across panels and across clusters, one may gain a bit more insight on what the interactions between the group means will be like.

Start from just two variables (uranium vs. temperature, uranium vs. time, etc.) and the build up from there. If your class has not covered interaction yet, then I'd suggest asking the instructor if he/she will allow you to experiment.

  • $\begingroup$ How did you make those plots such that they are side and side and in one image? $\endgroup$
    – DJ_
    Sep 20, 2013 at 3:05
  • $\begingroup$ @DJ_ It would probably differ software to software. I used SPSS to create this; I just drag acid and drop into the "column" attribute, and then SPSS would split the graphs into columns by acid level. But if you look closer, panel 1 is just a clustered boxplot/error plot with cases where acid==1, with some repetition you can create three different graphs and just insert them into the document, side by side. The only trick is to make sure the y-axis min and max are the same, or they will be difficult to compare. $\endgroup$ Sep 20, 2013 at 17:48

So I understand that your DV is numerical and your 3 IVs are categorical (3 levels). Boxplots is a good choice. You will have 9 boxplots, 3 for each IV.

Plot each IV separately. On the y axis will always be the DV (uranium). On the x-axis will the the IVs. For example, temp low, temp med, temp high. Do this for all 3 IVs.

If you want to look at the interaction between the IVs, plots will be more complicating (as will be your analysis). There's no easy way. You're just going to have to divide up the data into 6 when looking at 2 IVs, and 9 when looking at all 3 at once, and make boxplots for each. I don't suggest you do this. Given your skill level and because it is for a class, looking at one IV at a time is probably good enough.


Here's the '9x boxplot' approach in R:

### make reproducible
pred1 <- factor(c("low", "med", "high"), levels=c("low", "med", "high"))
df1 <- data.frame(ur=10*abs(runif(100)),
                  time=sample(pred1, 100, replace=TRUE),
                  temp=sample(pred1, 100, replace=TRUE),
                  str=sample(pred1, 100, replace=TRUE)
g1 <- ggplot(data=df1, aes(y=ur, x=time, fill=time))
g1 + geom_boxplot() +
 facet_grid(facets = str ~ temp, scale="free_y", labeller=label_both)


9x boxplots

(Note y-axis scales vary per row).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.