I'm trying to learn to use manova(), and don't understand why none of the following work:

> data(iris)
> fit <- manova(~ Species, data=iris)
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
incompatible dimensions
> fit <- manova(iris[,1:4] ~ Species, data=iris)
Error in model.frame(formula, rownames, variables, varnames, extras, extranames, :
invalid variable type
>
> YY <- iris[,1:4]
> species <- iris[,5]
> fit <- manova(YY ~ species)
Error in model.frame(formula, rownames, variables, varnames, extras, extranames, :
invalid variable type


It does work if I coerce YY to a matrix:

> fit <- manova(as.matrix(YY) ~ species)

But, ?manova gives no details, and just points to ?aov which says

    aov(formula, data = NULL, projections = FALSE, qr = TRUE,
        contrasts = NULL, ...)

Arguments:

formula: A formula specifying the model.

   data: A data frame in which the variables specified in the formula
         will be found. If missing, the variables are searched for in
         the standard way.
  ...

If this is not a bug, perhaps the documentation needs to be clearer. The only example for
manova() is found in ?summary.manova. (It would also help if model.frame returned
something to indicate which variable had an invalid type.)


-Michael

--
Michael Friendly Email: [EMAIL PROTECTED] Professor, Psychology Dept.
York University Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Street http://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT M3J 1P3 CANADA


______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to