Skip to content
Prev 168644 / 398502 Next

Q about how to use Anova.mlm

Dear Paul,

First, to fit a multivariate linear model to your data, you'll have to
rearrange the data from "long" format (with one observation per replicate)
to "wide" format (with one observation per subject). If your data are in the
data frame Data, then you'd do something like:

Wide <- reshape(Data, v.names="Angle", idvar="Subject", timevar="Replicate",
direction="wide")

Then, with the data in wide format, fit a multivariate linear model with
just a constant:

mod <- lm(cbind(Angle.1, Angle.2, Angle.3, Angle.4, Angle.5, Angle.6) ~ 1,
data=DavisThin)

Finally, use Anova() to get the tests:

idata <- data.frame(Replicate=c("Angle.1", "Angle.2", "Angle.3", "Angle.4",
"Angle.5", "Angle.6"))
summary(Anova(mod, idata=idata, idesign=~Replicate))

If I understand correctly what you want, this should give it to you.

As well, since your design has no between-subject factors and only a single
within-subject factor, you could also use anova() [i.e., anova.mlm()] to get
the same results.

I hope this helps,
 John

------------------------------
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox
On
I
6
an
some
http://www.R-project.org/posting-guide.html