28.14 Chi-square test – Test two categorical variables (chisq.test, table)

library(pwr)
ES = cohen.ES(test = "chisq", size = "medium")
pwr.chisq.test(w = ES$effect.size, N = NULL, df = 1, sig.level = 0.05, power = 0.8)
## 
##      Chi squared power calculation 
## 
##               w = 0.3
##               N = 87
##              df = 1
##       sig.level = 0.05
##           power = 0.8
## 
## NOTE: N is the number of observations