Here is your example.  The table you displayed in gigawiz ignored the
two-way factor structure
and interpreted the data as a single factor with 6 levels.  I created the
interaction of
a and b to get that behavior.


## your example, with data stored in a data.frame
tmp <- data.frame(x=c(76, 84, 78, 80, 82, 70, 62, 72,
                    71, 69, 72, 74, 66, 74, 68, 66,
                    69, 72, 72, 78, 74, 71, 73, 67,
                    86, 67, 72, 85, 87, 74, 83, 86,
                    66, 68, 70, 76, 78, 76, 69, 74,
                    72, 72, 76, 69, 69, 82, 79, 81),
                  a=factor(rep(c("A1", "A2"), each = 24)),
                  b=factor(rep(c("B1", "B2", "B3"), each=8, times=2)))
x.aov <- aov(x ~ a*b, data=tmp)
summary(x.aov)


## your request
require(multcomp)
tmp$ab <- with(tmp, interaction(a, b))
xi.aov <- aov(x ~ ab, data=tmp)
summary(xi.aov)
xi.glht <- glht(xi.aov, linfct=mcp(ab="Tukey"))
confint(xi.glht)


## graphs
## boxplots
require(lattice)
bwplot(x ~ ab, data=tmp)


## interaction plot
## install.packages("HH")  ## if you don't have HH yet
require(HH)
interaction2wt(x ~ a*b, data=tmp)


On Wed, Apr 4, 2012 at 1:10 PM, Jinsong Zhao <jsz...@yeah.net> wrote:

> On 2012-04-03 20:03, Rmh wrote:
>
>> yes.  See ?glht in the multcomp package, and the examples using glht in
>> ?MMC in the HH package.
>>
>> Sent from my iPhone
>>
>>
> Thank you very much for the clues. However, I can't figure out how to
> construct the linfct in glht.
>
> I also tried to inverse the computation based on:
> http://www.gigawiz.com/**images12/twowayrmposthoc.jpg<http://www.gigawiz.com/images12/twowayrmposthoc.jpg>
> However, I can't catch the MSE used in the above figure.
>
> Regards,
> Jinsong
>
>

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to