道具测试和费希尔';R中的s精确检验

道具测试和费希尔';R中的s精确检验,r,testing,statistics,statistical-test,R,Testing,Statistics,Statistical Test,我对使用费舍尔精确检验比较两种比例感到困惑。例如,我想测试9/13和3/18这两个比例之间是否存在差异。我只会打字 A <- c( 9, 3) B <- c( 13, 18) prop.test(A , B) 谢天谢地,有任何想法是的,与prop.test()相比,费舍尔测试的设置是不正确的 从prop.test帮助文件: prop.test(x, n, p = NULL, alternative = c("two.sided", "less&qu

我对使用费舍尔精确检验比较两种比例感到困惑。例如,我想测试9/13和3/18这两个比例之间是否存在差异。我只会打字

A <-  c( 9, 3)
B <-  c( 13, 18)
prop.test(A , B)

谢天谢地,有任何想法

是的,与
prop.test()
相比,费舍尔测试的设置是不正确的

从prop.test帮助文件:

prop.test(x, n, p = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, correct = TRUE)

x a vector of counts of successes,...

n a vector of counts of trials ...
费希尔检验

fisher.test(x, y = NULL, workspace = 200000, hybrid = FALSE,
            hybridPars = c(expect = 5, percent = 80, Emin = 1),
            control = list(), or = 1, alternative = "two.sided",
            conf.int = TRUE, conf.level = 0.95,
            simulate.p.value = FALSE, B = 2000)

x a two-dimensional contingency table in matrix form.
因此,如果13次和18次试验中的2次试验分别获得9次和3次成功,则意味着失败分别为4次和15次,因此Fishers试验应为:

A = matrix(c(9, 3, 4, 15), nrow = 2)
#Row sums are the total number of trials
#Column sums are the total number of True/False
 
fisher.test(A)

    Fisher's Exact Test for Count Data

data:  A
p-value = 0.007518
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  1.61038 89.70868
sample estimates:
odds ratio 
  10.18122 

这提供了与prop.test结果相当的结果。

是的,与
prop.test()
相比,费舍尔测试的设置不正确

从prop.test帮助文件:

prop.test(x, n, p = NULL, alternative = c("two.sided", "less", "greater"), conf.level = 0.95, correct = TRUE)

x a vector of counts of successes,...

n a vector of counts of trials ...
费希尔检验

fisher.test(x, y = NULL, workspace = 200000, hybrid = FALSE,
            hybridPars = c(expect = 5, percent = 80, Emin = 1),
            control = list(), or = 1, alternative = "two.sided",
            conf.int = TRUE, conf.level = 0.95,
            simulate.p.value = FALSE, B = 2000)

x a two-dimensional contingency table in matrix form.
因此,如果13次和18次试验中的2次试验分别获得9次和3次成功,则意味着失败分别为4次和15次,因此Fishers试验应为:

A = matrix(c(9, 3, 4, 15), nrow = 2)
#Row sums are the total number of trials
#Column sums are the total number of True/False
 
fisher.test(A)

    Fisher's Exact Test for Count Data

data:  A
p-value = 0.007518
alternative hypothesis: true odds ratio is not equal to 1
95 percent confidence interval:
  1.61038 89.70868
sample estimates:
odds ratio 
  10.18122 

这提供了与道具测试结果相当的结果。

“二维列联表”。列联表是每种情况下成功和失败的计数表。Wiki可以提供更好的定义:“二维列联表”。列联表是每种情况下成功和失败的计数表。Wiki可以提供更好的定义: