Caledonian26
Caledonian26

Reputation: 3

Unable to print specific values from an ANOVA table

I am using the code below:

data2 <- aov(y~x1+groupcategory+x1:groupcategory,data=df6)
data4 <- summary(data2)
data5 <- data4["Pr(>F)"]

data5 is printing 'NULL' but I am unsure as to why!?

Upvotes: 0

Views: 234

Answers (1)

StupidWolf
StupidWolf

Reputation: 46968

The output of summary(aov(..)) is a list. Do

data4 = summary(aov(mpg ~ .,data=mtcars))
data4[[1]]["Pr(>F)"]
             Pr(>F)    
cyl         < 2e-16 ***
disp        0.03091 *  
hp          0.26103    
drat        0.14064    
wt          0.00324 ** 
qsec        0.46166    
vs          0.89317    
am          0.16586    
gear        0.71365    
carb        0.81218    
Residuals              
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Upvotes: 1

Related Questions