14.3 Use ANOVA
The Null hypothesis is: \[H_0: \text{it is true that } \mu_P=\mu_A=\mu_J\] While the alternative is:
\[H_0: \text{it is NOT true that } \mu_P=\mu_A=\mu_J\]
The Sample Variance of Y: \[Var(Y)=\frac{1}{N}\sum_{k=1}^G\sum_{i=1}^{N_k}(Y_{ik}-\bar{Y})^2\] ### Example 2
data2 <- tibble(name=c("Ann","Ben","Cat","Dan","Egg"),
person_p=seq_along(1:5),
group=c("cool","cool","cool","uncool","uncool"),
group_k=c(1,1,1,2,2),
index_i=c(1,2,3,1,2),
grumpiness_Yp=c(20,55,21,91,22)
)
data2
## # A tibble: 5 × 6
## name person_p group group_k index_i grumpiness_Yp
## <chr> <int> <chr> <dbl> <dbl> <dbl>
## 1 Ann 1 cool 1 1 20
## 2 Ben 2 cool 1 2 55
## 3 Cat 3 cool 1 3 21
## 4 Dan 4 uncool 2 1 91
## 5 Egg 5 uncool 2 2 22
\[Var(Y)=\frac{1}{N}\sum_{p=1}^{N}(Y_{p}-\bar{Y})^2\]