[R] Command for simple effects following 2 way anova with interaction
Richard M. Heiberger
rmh at temple.edu
Thu Dec 1 06:08:11 CET 2016
## Use the split argument to summary.aov
## This tests the levels of tension within each level of wool using a common
## Residuals sum of squares.
model2 <- aov(breaks ~ wool/tension, data = warpbreaks)
##  "(Intercept)" "woolB" "woolA:tensionM" "woolB:tensionM"
##  "woolA:tensionH" "woolB:tensionH"
## The less good choice has the same numerator sums of squares but
## different Residuals sums of squares, with fewer df for each,
## and comes to different conclusions.
model3A <- aov(breaks ~ tension,
data = warpbreaks[warpbreaks$wool=="A",])
model3B <- aov(breaks ~ tension,
data = warpbreaks[warpbreaks$wool=="B",])
## The boxplots show that model2 better describes the data.
## There is a significant difference for woolA and not for woolB.
bwplot(breaks ~ tension | wool, data=warpbreaks)
On Wed, Nov 30, 2016 at 10:55 PM, Ashim Kapoor <ashimkapoor at gmail.com> wrote:
> Dear All,
> Suppose I do :-
> model1<- aov(breaks ~ wool*tension,data = warpbreaks)
> There is significant interaction. So I need to test for simple effects of
> wool at each level of tension and vice versa. I can do a subset and then
> do a one way anova for each level of tension and wool. My query is that is
> there any command programmed which can do this automatically?
> Best Regards,
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help