Using R, I have to perform a test to test if the number of coronavirus cases is evenly distributed in some areas in respect to those areas populations and then if they are not evenly distributed with alpha = 0.05, test which areas are different. Our lecturer gave us hints, that whe should perform Chi-Square goodness of fit test to decide if they are evenly distributed, and then perform bonferroni type test to know which areas are different.
I have already performed chi squared test by first calculating probabilities vector as taking populations and dividing them by sum of all populations:
populations <-c(2117619, 1428983, 2901225, 1181533, 1014548, 986506, 2466322)
cases <- c(66304, 54354, 89167, 34580, 31573, 36875, 86068)
probabilities.vect <- populations / sum(populations)
chisq.test(x=cases, probabilities.vect)
which returns
Pearson's Chi-squared test
data: cases and probabilities.vect X-squared = 42, df = 36, p-value =
0.227
I dont know why but the code I included above is raising a warning:
Warning message: In chisq.test(x = cases, probabilities.vect) :
Chi-squared approximation may be incorrect
Did I make some kind of mistake while performing this test?
I also dont know how to perform bonferroni test
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…