[R] Post Hoc Groupings
Quick question, as I attempt to learn R. For post-hoc tests 1) Is there an easy function that will take, say the results of tukeyHSD and create a grouping table. e.g., if I have treatments 1, 2, and 3, with 1 and 2 being statistically the same and 3 being different from both Group Treatment A 1 A 2 B 3 2) I've been stumbling over the proper syntax for simple effects for a tukeyHSD test. Is it TukeyHSD(model.aov, Treatment1, Treatment2) or TukeyHSD(model, c(Treatment1, Treatment2)) or something else, as neither of those seem to really work. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Post Hoc Groupings
Jarrett Byrnes wrote: Quick question, as I attempt to learn R. For post-hoc tests 1) Is there an easy function that will take, say the results of tukeyHSD and create a grouping table. e.g., if I have treatments 1, 2, and 3, with 1 and 2 being statistically the same and 3 being different from both Group Treatment A 1 A 2 B 3 2) I've been stumbling over the proper syntax for simple effects for a tukeyHSD test. Is it TukeyHSD(model.aov, Treatment1, Treatment2) or TukeyHSD(model, c(Treatment1, Treatment2)) or something else, as neither of those seem to really work. Re question 2, using the example in the help file: fm1 - aov(breaks ~ wool + tension, data = warpbreaks) TukeyHSD(fm1, c(wool,tension)) Note that wool, tension must be factors. [In the help file for TukeyHSD, argument 'which' is defined as a list of terms. Maybe that should be changed to a character vector.] Peter __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Post Hoc Groupings
Indeed, the following works as well On Oct 26, 2005, at 5:23 PM, P Ehlers wrote: fm1 - aov(breaks ~ wool*tension, data = warpbreaks) TukeyHSD(fm1, c(wool,tension, wool:tension)) However, when working with my own dataset, I get the following errors. I have some inkling this may be due to a slightly unbalanced sample size, but am uncertain of this. rich.aov - aov(X.open ~ Dock*Slip, data=dock_2004_data) TukeyHSD(rich.aov, c(Dock, Slip)) Error in rep.int(n, length(means)) : unimplemented type 'NULL' in 'rep' In addition: Warning messages: 1: non-factors ignored: Slip in: replications(paste(~, xx), data = mf) 2: non-factors ignored: Dock, Slip in: replications(paste(~, xx), data = mf) I am pleased to know that these errors are not quite the __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Post Hoc Groupings
Looking at the errors your code produces, it looks like you need to make Dock and Slip factors. dock_2004_data$Dockf-factor(dock_2004_data$Dock) dock_2004_data$Slipf-factor(dock_2004_data$Slip) rich.aov - aov(X.open ~ Dockf*Slipf, data=dock_2004_data) TukeyHSD(rich.aov, c(Dockf, Slipf)) Jarrett Byrnes wrote: Indeed, the following works as well On Oct 26, 2005, at 5:23 PM, P Ehlers wrote: fm1 - aov(breaks ~ wool*tension, data = warpbreaks) TukeyHSD(fm1, c(wool,tension, wool:tension)) However, when working with my own dataset, I get the following errors. I have some inkling this may be due to a slightly unbalanced sample size, but am uncertain of this. rich.aov - aov(X.open ~ Dock*Slip, data=dock_2004_data) TukeyHSD(rich.aov, c(Dock, Slip)) Error in rep.int(n, length(means)) : unimplemented type 'NULL' in 'rep' In addition: Warning messages: 1: non-factors ignored: Slip in: replications(paste(~, xx), data = mf) 2: non-factors ignored: Dock, Slip in: replications(paste(~, xx), data = mf) I am pleased to know that these errors are not quite the __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Re: [R] Post Hoc Groupings
Indeed, that does it. Odd. I guess as Slip was a number, it needed to be categorized. Interesting... Not if only I can figure out how to get the TukeyHSD grouping table On Oct 26, 2005, at 7:35 PM, Mark Lyman wrote: Looking at the errors your code produces, it looks like you need to make Dock and Slip factors. dock_2004_data$Dockf-factor(dock_2004_data$Dock) dock_2004_data$Slipf-factor(dock_2004_data$Slip) rich.aov - aov(X.open ~ Dockf*Slipf, data=dock_2004_data) TukeyHSD(rich.aov, c(Dockf, Slipf)) Jarrett Byrnes wrote: Indeed, the following works as well On Oct 26, 2005, at 5:23 PM, P Ehlers wrote: fm1 - aov(breaks ~ wool*tension, data = warpbreaks) TukeyHSD(fm1, c(wool,tension, wool:tension)) However, when working with my own dataset, I get the following errors. I have some inkling this may be due to a slightly unbalanced sample size, but am uncertain of this. rich.aov - aov(X.open ~ Dock*Slip, data=dock_2004_data) TukeyHSD(rich.aov, c(Dock, Slip)) Error in rep.int(n, length(means)) : unimplemented type 'NULL' in 'rep' In addition: Warning messages: 1: non-factors ignored: Slip in: replications(paste(~, xx), data = mf) 2: non-factors ignored: Dock, Slip in: replications(paste(~, xx), data = mf) I am pleased to know that these errors are not quite the __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html