[R] Multiple comparisons on Anova.mlm object
John Fox
jfox at mcmaster.ca
Sat Apr 17 00:36:08 CEST 2010
Dear Gabriel and Bert,
Bert's points are well taken, but you can compute tests of linear hypotheses
for a repeated-measures MANOVA using the linear.hypothesis function in the
car package. I'm not sure how you'd correct these tests for simultaneous
inference with anything other than a Bonferroni adjustment.
Regards,
John
--------------------------------
John Fox
Senator William McMaster
Professor of Social Statistics
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of Bert Gunter
> Sent: April-16-10 4:19 PM
> To: 'Kaufman Gabriel'; r-help at r-project.org
> Subject: Re: [R] Multiple comparisons on Anova.mlm object
>
> Gabriel:
>
> The post hoc comparison tests that you reference are of doubtful validity
or
> utility in anything but balanced designs with simple covariance
structures.
> With missing data there are two critical issues: why are the data missing
> and how do they need to be handled as a result? -- just ignoring them may
> produce biased results if it's "informative" missingness, and inference is
> even more of a headache(it's difficult, unknown, or unresolvable depending
> on the details). I strongly suggest you consult a local statistical
expert.
>
>
> Bert Gunter
> Genentech Nonclinical Statistics
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of Kaufman Gabriel
> Sent: Friday, April 16, 2010 12:32 PM
> To: r-help at r-project.org
> Subject: [R] Multiple comparisons on Anova.mlm object
>
> I would like to perform multiple comparisons or post-hoc testing on the
> independent variable in an Anova.mlm object generated by the Anova
function
> of the car package. I have defined a multivariate linear model and
> subsequently performed a repeated measures ANOVA as per the instructions
in
> section #3 of the following comprehensive tutorial on the subject from the
> Gribble lab at UWO:
> http://gribblelab.org/2009/03/09/repeated-measures-anova-using-r
> Unfortunately, since my data has missing values,I can't seem to use the
> classical univariate approaches of aov() or lme() (suggested in sections
#1
> and #2 of the tutorial linked to above).
>
> The relevant portions of the R console output are copied below (redacted
> somewhat for intellectual property considerations). In sum, I am stuck at
> the Anova.mlm object, as I cannot seem to apply any of the standard
multiple
> comparisons functions such as pairwise.t.test or p.adjust....
>
>
> Thank you in advance for your help.
>
>
> Gabriel Kaufman
> Orthopedic Molecular Biology Laboratory
> Centre de recherche CHU Sainte-Justine
> Montreal, Quebec
>
> --------------------------
>
> R console output
>
> > # define Treatment group as the factor defining the intra-subject model
> > as.factor(Treatment)
> > ## define repeated measures linear model
> > # define repeated-measures data as matrix vector
> > RM <- cbind(repeated_measure_1, repeated_measure_2, repeated_measure_3,
> repeated_measure_4, repeated_measure_5)
> > mlm <- lm(RM ~ Treatment, data = RMdata.file)
> > # load required package car
> > library(car)
> > ## Define Anova model object for repeated-measures ANOVA
> > # define idata data frame
> > idata <- data.frame(RM = factor(1:5))
> > # define Anova object
> > mlm.aov <- Anova(mlm, idata = idata,idesign = ~RM, type = "II")
> > # display class of Anova object
> > class(mlm.aov)
> [1] "Anova.mlm"
> > # display session information
> > sessionInfo()
> R version 2.10.1 (2009-12-14)
> i386-apple-darwin9.8.0
>
> locale:
> [1] en_CA.UTF-8/en_CA.UTF-8/C/C/en_CA.UTF-8/en_CA.UTF-8
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] car_1.2-16
>
> ______________________________________________
> R-help at 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.
>
> ______________________________________________
> R-help at 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.
More information about the R-help
mailing list