1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

多群間の比率の検定

Last updated at Posted at 2021-03-16

多群間での比率の検定では、分散分析のように、まずは「全体として群間で比率に差があるか」を検定する。
その結果が有意であるならば、さらに、下位検定として比率の検定の多重比較を行う。

(2021/3/17)
https://www.jstage.jst.go.jp/article/kagakutoseibutsu/57/10/57_571007/_article/-char/ja
上記の文献によると、必ずしも全体としての検定をする必要はないようです。

以下はその例。

L1 <- 22
L2 <- 26
L3 <- 43
U1 <- 11
U2 <- 40
U3 <- 23

# まず全体としての比率の差をテスト
# fisher.test(matrix(c(L1,L2,L3,U1,U2,U3),ncol=2,byrow = T))

# 続いて多重比較
library(RVAideMemoire)
fisher.multcomp(matrix(c(L1,L2,L3,U1,U2,U3),ncol=2,byrow = T))

結果

# > fisher.test(matrix(c(L1,L2,L3,U1,U2,U3),ncol=2,byrow = T))
#
#	Fisher's Exact Test for Count Data
#
# data:  matrix(c(L1, L2, L3, U1, U2, U3), ncol = 2, byrow = T)
# p-value = 0.001586
# alternative hypothesis: two.sided
#
> fisher.multcomp(matrix(c(L1,L2,L3,U1,U2,U3),ncol=2,byrow = T))

        Pairwise comparisons using Fisher's exact test for count data

data:  matrix(c(L1, L2, L3, U1, U2, U3),2,T)

         A       B
B 0.001421       -
C 0.082826 0.08283

P value adjustment method: fdr
1
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?