I am returning this to the R-help list. Please keep followups on the list. Yes, it can be done. It is not currently easy because multcomp doesn't have the syntax yet. Making this easy is on Torsten's to-do list for the multcomp package. See the MMC.WoodEnergy example in the HH package. The current version on CRAN is HH_1.17. Please see the discussion of this example in R-help: https://stat.ethz.ch/pipermail/r-help/2007-January/123451.html ---- Original message ---->Date: Mon, 29 Jan 2007 16:42:35 +0100 (CET) >From: "Jorge Lampurlanes Castel" <jlampur at eagrof.UdL.es> >Subject: Re: [R] LSD multiple comparison test >To: "Richard M. Heiberger" <rmh at temple.edu> > >Thank you very much for your useful advice. >I do not found LSD but I am using Tukey test instead. > >In the model: > > lm.1 <- lm(variable ~ BLOC + TIL * YEAR , data=selvanera) > > >I found TIL*YEAR interaction significant. Then I am trying to compare >means of the different levels of TIL inside every YEAR using: > > mc.2 <- glht(lm.1, linfct = mcp(TIL*YEAR="Tukey")) > summary(mc.2, test = univariate()) > >but it does not work. > >There is any way of doing it, like the SLICE option in PROC GLM (SAS)? > >Thanks a lot, > >Jorge > >> Look at the glht function in the multcomp package and the >> MMC functions in the HH package. >> >> Rich >> > > >-- >************************************************** >Jorge Lampurlan?s Castel >Departament d'Enginyeria Agroforestal >Escola T?cnica Superior d'Enginyeria Agr?ria >Universitat de Lleida >Avinguda Rovira Roure, 191 >25198-LLEIDA >SPAIN > >Tl.: +34 973 70 25 37 >Fax.:+34 073 70 26 73 >e-mail: jlampur at eagrof.udl.es >************************************************** >
As I understand from the WoodEnergy example in package HH, You are proposing to compute a separate lm for each level of YEAR factor to compare TIL means. This is the way I used to do this kind of analysis. But now, it is also possible, with PROC GLM, to adjust only the general model (variable ~ BLOC + TIL * YEAR ) and then to compare TIL means inside every YEAR with the SLICE option. I am not statistician but I think the difference is that, in the first approach, we use a different error term for every YEAR, whereas in the second approach, we use the same error term for all comparisons. Perhaps the differences between both approaches are negligible. If not, it is possible to do this analysis in R? Thanks a lot. -- ************************************************** Jorge Lampurlan?s Castel Departament d'Enginyeria Agroforestal Escola T?cnica Superior d'Enginyeria Agr?ria Universitat de Lleida Avinguda Rovira Roure, 191 25198-LLEIDA SPAIN Tl.: +34 973 70 25 37 Fax.:+34 073 70 26 73 e-mail: jlampur at eagrof.udl.es