I want to conduct a theoretical chi square goodness of fit test:
actual <- c(20,80)
expected <- c(10,90)
chisq.test(expected,actual)
Sample size n=100, alpha=0.05, df=1. This gives a critical chi value of 3.84. By hand I can calculate the test statistic to be ((20-10)^2)/10 + ((80-90)^2)/90 = 100/9 > 3.84
However, the above code just yields
Pearson's Chi-squared test with Yates' continuity correction
data: expected and actual
X-squared = 0, df = 1, p-value = 1
Where is my mistake?