Dear list, im facing an issue of statistical data analysis that I consider myself unable to resolve in R so i hope to get some valuable insights from you. i run an ANOVA with four factors; factor4 is an between factor (two different groups measured), the others are withins (tested across /all/ subjects). accordingly, my model looks as follows: fm1 <-aov(dataSubjects~(factor1*factor2*factor3*factor4)+Error(subject/(factor1* factor2*factor3))+factor4,data=mydata) print(summary(fm1)) so far so good. i now would like to perform multiple comparisons, but separately for each level of factor4 (two). this is how I do it: i sort out (using subset) the levels im interested in comparing, say level 1 of factor 1 Type.lvl1 <- subset(mydata, factor1 == "lvl1") and then compute an uncorrected pairwise t-test between the two levels of factor 4: Type.lvl1.P<-pairwise.t.test(Type.lvl1$dataSubjects,Type.lvl1$factor4,p.adj = "none") i do this for every comparison im interested in and apply any method for multiple comparison correction afterwards on the entire set of p values obtained. is this valid (in statistical terms)? if not, could anyone refer to a better procedure i should use instead? Thanks in advance. Lisa WEB.DE DSL Doppel-Flat ab 19,99 ?/mtl.! Jetzt mit gratis Handy-Flat! [1]http://produkte.web.de/go/DSL_Doppel_Flatrate/2 References 1. http://produkte.web.de/go/DSL_Doppel_Flatrate/2
Lisa, Please look at some of the demos in the HH package. These are built on the capabilities of the glht function in the multcomp package. ## install.packages("HH") ## if necessary library(HH) demo("MMC.WoodEnergy-aov", package="HH") ## first demo("MMC.WoodEnergy", package="HH") ## second Rich On Wed, Apr 27, 2011 at 5:02 AM, <elgoran@web.de> wrote:> > Dear list, > im facing an issue of statistical data analysis that I consider myself > unable to resolve in R so i hope to get some valuable insights from you. > i > run an ANOVA with four factors; factor4 is an between factor (two > different > groups measured), the others are withins (tested across /all/ subjects). > accordingly, my model looks as follows: > fm1 > > <-aov(dataSubjects~(factor1*factor2*factor3*factor4)+Error(subject/(factor1* > factor2*factor3))+factor4,data=mydata) > print(summary(fm1)) > so far so good. i now would like to perform multiple comparisons, but > separately for each level of factor4 (two). this is how I do it: i sort > out > (using subset) the levels im interested in comparing, say level 1 of > factor > 1 > Type.lvl1 <- subset(mydata, factor1 == "lvl1") > and then compute an uncorrected pairwise t-test between the two levels of > factor 4: > > Type.lvl1.P<-pairwise.t.test(Type.lvl1$dataSubjects,Type.lvl1$factor4,p.adj > = "none") > i do this for every comparison im interested in and apply any method for > multiple comparison correction afterwards on the entire set of p values > obtained. is this valid (in statistical terms)? if not, could anyone > refer > to a better procedure i should use instead? > Thanks in advance. > Lisa > > WEB.DE <http://web.de/> DSL Doppel-Flat ab 19,99 €/mtl.! Jetzt mit > gratis Handy-Flat! [1]http://produkte.web.de/go/DSL_Doppel_Flatrate/2 > > References > > 1. http://produkte.web.de/go/DSL_Doppel_Flatrate/2 > ______________________________________________ > 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<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Rich, thanks a lot, i will definitly check it out. however, since the analysis mentioned above is already implemented could you or anyone tell me whether it contains any statistical flaws? best Lisa ______________________________________________________________ Von: "Richard M. Heiberger" <rmh at temple.edu> Gesendet: 27.04.2011 16:58:43 An: elgoran at web.de Betreff: Re: [R] multiple comparisons on a between factor Lisa, Please look at some of the demos in the HH package. These are built on the capabilities of the glht function in the multcomp package. ## install.packages("HH") ## if necessary library(HH) demo("MMC.WoodEnergy-aov", package="HH") ## first demo("MMC.WoodEnergy", package="HH") ## second Rich On Wed, Apr 27, 2011 at 5:02 AM, <[1]elgoran at web.de> wrote: Dear list, im facing an issue of statistical data analysis that I consider myself unable to resolve in R so i hope to get some valuable insights from you. i run an ANOVA with four factors; factor4 is an between factor (two different groups measured), the others are withins (tested across /all/ subjects). accordingly, my model looks as follows: fm1 <-aov(dataSubjects~(factor1*factor2*factor3*factor4)+Error(subject/(factor 1* factor2*factor3))+factor4,data=mydata) print(summary(fm1)) so far so good. i now would like to perform multiple comparisons, but separately for each level of factor4 (two). this is how I do it: i sort out (using subset) the levels im interested in comparing, say level 1 of factor 1 Type.lvl1 <- subset(mydata, factor1 == "lvl1") and then compute an uncorrected pairwise t-test between the two levels of factor 4: Type.lvl1.P<-pairwise.t.test(Type.lvl1$dataSubjects,Type.lvl1$factor4,p.ad j = "none") i do this for every comparison im interested in and apply any method for multiple comparison correction afterwards on the entire set of p values obtained. is this valid (in statistical terms)? if not, could anyone refer to a better procedure i should use instead? Thanks in advance. Lisa [2]WEB.DE DSL Doppel-Flat ab 19,99 ?/mtl.! Jetzt mit gratis Handy-Flat! [1][3]http://produkte.web.de/go/DSL_Doppel_Flatrate/2 References 1. [4]http://produkte.web.de/go/DSL_Doppel_Flatrate/2 ______________________________________________ [5]R-help at r-project.org mailing list [6]https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide [7]http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Empfehlen Sie WEB.DE DSL Ihren Freunden und Bekannten und wir belohnen Sie mit bis zu 50,- Euro! [8]https://freundschaftswerbung.web.de References 1. mailto:elgoran at web.de 2. http://web.de/ 3. http://produkte.web.de/go/DSL_Doppel_Flatrate/2 4. http://produkte.web.de/go/DSL_Doppel_Flatrate/2 5. mailto:R-help at r-project.org 6. https://stat.ethz.ch/mailman/listinfo/r-help 7. http://www.r-project.org/posting-guide.html 8. https://freundschaftswerbung.web.de/