Why is the estimate value of aov is impossible to extract?

Hello folks.
When computing an aov (and probably some other alike-methods) it's impossible to call the SSB.

aov(value~group,i2_btween)
Call:
   aov(formula = value ~ group, data = i2_btween)

Terms:
                   group Residuals
Sum of Squares  420.8522   24.9973
Deg. of Freedom        1         8

Residual standard error: 1.767671
Estimated effects may be unbalanced

Don't mind the warning, Do you have a clue how i might parametrrize this? I tried assigning to an object and using the $ or [ and [[. It's almost as if they hid it under the 'term'...

I may have misunderstood your question. Running code like the following will give you a data frame from which you can get the sums of squares, mean sums of square, degrees of freedom, etc.

AnovaFit <- aov(Y ~ pop, data = DF)
AnovaDF <- summary(AnovaFit)[[1]]
1 Like

Oh dang I totally forgot about trying to call via summary!
I did not check just yet but I believe you are absolutely right :smiley:

Thank you sir,
I found it.

To extract the numeric value of the SSB you need to:

reg_aov <- aov(scores~groups,data)
summary_aov <- summary(reg_aov)
summary_aova[1]][1,2]

Which stands for:
[[1]] The first (and only) object in the object of type list contains the summary call.
[1,2] The first row and the second column (which is where the numeric value is stored).

As a minor point, you could also get the value using row and column names, which would make the intent of the code clearer.

summary_aova[[1]]["groups", "Sum Sq"]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.