Output from aov
also have a component called model
which contains the data, ie. a.model$model$score
is identical to lm(a.model)$model$score
.
Function names
is useful:
> names(a.model)
[1] "coefficients" "residuals"
[3] "effects" "rank"
[5] "fitted.values" "assign"
[7] "qr" "df.residual"
[9] "contrasts" "xlevels"
[11] "call" "terms"
[13] "model"
Another way which is perhaps more convienient and works in more general cases, is to use functions model.matrix
and model.frame
which give the desing matrix and the whole model used in formula. In your second example (in comments) you can use model.frame
to get the data.