Computing anova table in r

Viewed 28

I know that you can get an anova table by using anova(). However, that's if you have the data already in r (ie you have a file and you read it into r). But I have a printed table as shown below:enter image description here

How do I compute an anova table from this using r?

Thank you!

1 Answers

you can use this as your template for creating the df by hand

df <- data.frame(
Gender = c('Male', 'Male', 'Male', 'Male', 'Male', 'Male', 'Sub Mean', 'Female', 'Female', 'Female', 'Female', 'Female', 'Female', 'Sub Mean', 'Age Mean'),
    Young=c(21,23,19,22,22,23,21.67,21,22,20,21,19,25,21.33,21.5),
    Middle=c(30,29,26,28,27,27,27.83,26,29,27,28,27,29,27.67,27.75),
    Elderly = c(25,22,23,21,22,21,22.33,23,19,20,21,20,20,20.50,21.42)
)

df
Related