In my laboratory we used a statistical software package, but now we are using R for the statistics.
Using the statistical software, after a two-way ANOVA, a table with the results includes "Source of variation" and "% of total variation". How can I get those values from R?
Example: This data set
Temperature <- factor(c(rep("cold", times = 4),
rep("hot", times = 4)),
levels = c("cold", "hot"))
Light <- factor(rep(c(rep("blue", times = 2),
rep("yellow", times = 2)),
times = 2),
levels = c("blue", "yellow"))
Result <- c(90.40, 85.20, 21.70, 25.30,
75.12, 77.36, 6.11, 10.8)
Data <- data.frame(Temperature, Light, Result)
2-way ANOVA in R:
two_wayANOVA <- aov(data = Data,
formula = Result ~ Temperature * Light)
summary(two_wayANOVA)
Df Sum Sq Mean Sq F value Pr(>F)
Temperature 1 354 354 42.250 0.00289 **
Light 1 8723 8723 1041.366 5.5e-06 ***
Temperature:Light 1 6 6 0.725 0.44250
Residuals 4 34 8
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
In the statistical software:

