forked from konaraddi/cmsc320-final
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanova_generation_similarity2.Rmd
28 lines (17 loc) · 1.14 KB
/
anova_generation_similarity2.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
### Attack
Do newer generations have more Attack than previous generations?
First, let's take a look at the average attack for each generation:
```{r}
library(dplyr)
pokedex.table %>%
group_by(Gen) %>%
summarise(average_attack = mean(Attack))
```
We can already tell that there seems to be some variation in the average attack across generations. We can see that average attack of generation VII are more than 10 than the average of Gen I. At the same time however, we see that gen I, III, and VI are almost exactly the same with their average attack. The Question remains however if this variation is statistically significant? Let's use the ANOVA/F-test at 5% level of significance.
$H_o =$ no difference between true average attack across generations
$H_a =$ at least two generations' average attack are different
```{r}
res.aov <- aov(Attack ~ Gen, data = pokedex.table)
summary(res.aov)
```
We can see here that we have received a F-value of 4.525 which generates a p-value extremely small (0.000161. Therefore, we have sufficient evidence to reject the null hypothesis ($H_o$). We conclude that at least two generations vary with their attack.