library(coin)
davis <- matrix( c( 3, 6, 2, 19 ), nrow = 2, byrow = TRUE)
davis <- as.table(davis)
ct1 <- chisq_test(davis, distribution = approximate(nresample = 10000))
cat(size(ct1, alpha = 0.05),"\n")
ct2 <- chisq_test(davis, distribution = "exact")
cat(size(ct2, alpha = 0.05),"\n")
ct3 <- chisq_test(davis, distribution = "asymptotic")
cat(size(ct3, alpha = 0.05))
得到:
0.0196
0.01945181
NA
问题是:
1、size函数的返回值何意?作何用?怎么得到的?
2、为何distribution为 approximate和exact时有返回值,为asymptotic时无返回值