Dear all,
glht (from the multcomp package) needs a term and a model component
in it's fitted model.
In fitted models from e.g. repeated measurements ANOVAs I do not find
neither model nor term.
Is it possible to build together a model and term component myself,
so that glht will work for repeated measurements ANOVAs? If so, how
would I do that?
Best regards,
Michael Zehetleitner
For example (senseless, but it makes the point):
--------- snip -------------
> amod <- aov(breaks ~ tension, data = warpbreaks)
> amod.err <- aov(breaks ~ tension + Error(wool/tension), data =
warpbreaks)
>
> class(amod)
[1] "aov" "lm"
> class(amod.err[["wool:tension"]])
[1] "aov" "lm"
>
> names(amod)
[1] "coefficients" "residuals" "effects" "rank"
"fitted.values" "assign" "qr"
[8] "df.residual" "contrasts" "xlevels" "call"
"terms" "model"
> names(amod.err[["wool:tension"]])
[1] "coefficients" "residuals" "effects" "rank"
"fitted.values" "assign" "qr"
[8] "df.residual" "terms"
>
> setdiff(names(amod), names(amod.err[["wool:tension"]]))
[1] "contrasts" "xlevels" "call" "model"
>
> glht(amod[["wool:tension"]], linfct = mcp(tension = "Tukey"))
Error in terms.default(object) : no terms component
Error in factor_contrasts(model) : no 'model.matrix' method for
'model' found!
--------------- end snip ----------------
----------------------------------------
Michael Zehetleitner, M.Sc.
Allgemeine und Experimentelle Psychologie I
Ludwig-Maximilian Universität München
[[alternative HTML version deleted]]
______________________________________________
[email protected] 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.