#1 chisq.test(x=c(10, 25, 18, 6), p=rep(1/4, 4)) # Chi-squared test for given # probabilities # # data: c(10, 25, 18, 6) # X-squared = 14.559, df = 3, p-value # = 0.002235 test.res<-chisq.test(x=c(10, 25, 18, 6), p=rep(1/4, 4)) test.res$observed-test.res$expected # [1] -4.75 10.25 3.25 -8.75 #2 chisq.test(x=c(125, 60,50, 12), p=c(9/16, 3/16,3/16,1/16)) # Chi-squared test for given # probabilities # # data: c(125, 60, 50, 12) # X-squared = 6.5025, df = 3, p-value # = 0.08956 #3 sum(c(1200 , 200, 650, 200)) # [1] 2250 chisq.test(x=c(41, 5, 30,2), p=c(1200/2250 , 200/2250, 650 /2250, 200/2250)) # Chi-squared test for given # probabilities # # data: c(41, 5, 30, 2) # X-squared = 6.5322, df = 3, p-value # = 0.0884 #4 pchisq(5.04, df=3, lower.tail = F) # [1] 0.1688915 #5 qchisq(0.05, 3, lower.tail = F) # [1] 7.814728 qchisq(0.01, 3, lower.tail = F) # [1] 11.34487 #E chisq.test(c(19,61, 25), p=c(1/4,2/4, 1/4)) # X-squared = 3.4381, df = 2, p-value # = 0.1792