Skip to main content
added 244 characters in body
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

The question you are asking is about agreement. You may want to check out John Uebersax's website on agreement. You need to think in terms of the format of your second contingency table, because your data are matched in the sense that the observations are of the same genes. The test you want is Cohen's kappaCohen's kappa. In R, it could be done like this:

library(irr)  # you need to use this package
dat = matrix(c(rep(c("u", "d"), 4),  # here I input your data
               rep(c("d", "u"), 2),
           rep(c("d", "d"), 9) ), ncol=2, byrow=T)
dat
#       [,1] [,2]
#  [1,] "u"  "d" 
#  [2,] "u"  "d" 
#  [3,] "u"  "d" 
#  [4,] "u"  "d" 
#  [5,] "d"  "u" 
#  [6,] "d"  "u" 
#  [7,] "d"  "d" 
#  [8,] "d"  "d" 
#  [9,] "d"  "d" 
# [10,] "d"  "d" 
# [11,] "d"  "d" 
# [12,] "d"  "d" 
# [13,] "d"  "d" 
# [14,] "d"  "d" 
# [15,] "d"  "d" 
kappa2(dat)  # this is the test, you have (non-significant) disagreement
#  Cohen's Kappa for 2 Raters (Weights: unweighted)
# 
#  Subjects = 15 
#    Raters = 2 
#     Kappa = -0.216 
# 
#         z = -0.916 
#   p-value = 0.36 
library(irr)                         # you need to use this package
dat = matrix(c(rep(c("u", "d"), 4),  # here I input your data
               rep(c("d", "u"), 2),
               rep(c("d", "d"), 9) ), ncol=2, byrow=T)
dat
#       [,1] [,2]
#  [1,] "u"  "d" 
#  [2,] "u"  "d" 
#  [3,] "u"  "d" 
#  [4,] "u"  "d" 
#  [5,] "d"  "u" 
#  [6,] "d"  "u" 
#  [7,] "d"  "d" 
#  [8,] "d"  "d" 
#  [9,] "d"  "d" 
# [10,] "d"  "d" 
# [11,] "d"  "d" 
# [12,] "d"  "d" 
# [13,] "d"  "d" 
# [14,] "d"  "d" 
# [15,] "d"  "d" 
kappa2(dat)  # this is the test, you have (non-significant) disagreement
#  Cohen's Kappa for 2 Raters (Weights: unweighted)
# 
#  Subjects = 15 
#    Raters = 2 
#     Kappa = -0.216 
#         z = -0.916 
#   p-value = 0.36 

The question you are asking is about agreement. You need to think in terms of the format of your second contingency table, because your data are matched in the sense that the observations are of the same genes. The test you want is Cohen's kappa. In R, it could be done like this:

library(irr)  # you need to use this package
dat = matrix(c(rep(c("u", "d"), 4),  # here I input your data
               rep(c("d", "u"), 2),
           rep(c("d", "d"), 9) ), ncol=2, byrow=T)
dat
#       [,1] [,2]
#  [1,] "u"  "d" 
#  [2,] "u"  "d" 
#  [3,] "u"  "d" 
#  [4,] "u"  "d" 
#  [5,] "d"  "u" 
#  [6,] "d"  "u" 
#  [7,] "d"  "d" 
#  [8,] "d"  "d" 
#  [9,] "d"  "d" 
# [10,] "d"  "d" 
# [11,] "d"  "d" 
# [12,] "d"  "d" 
# [13,] "d"  "d" 
# [14,] "d"  "d" 
# [15,] "d"  "d" 
kappa2(dat)  # this is the test, you have (non-significant) disagreement
#  Cohen's Kappa for 2 Raters (Weights: unweighted)
# 
#  Subjects = 15 
#    Raters = 2 
#     Kappa = -0.216 
# 
#         z = -0.916 
#   p-value = 0.36 

The question you are asking is about agreement. You may want to check out John Uebersax's website on agreement. You need to think in terms of the format of your second contingency table, because your data are matched in the sense that the observations are of the same genes. The test you want is Cohen's kappa. In R, it could be done like this:

library(irr)                         # you need to use this package
dat = matrix(c(rep(c("u", "d"), 4),  # here I input your data
               rep(c("d", "u"), 2),
               rep(c("d", "d"), 9) ), ncol=2, byrow=T)
dat
#       [,1] [,2]
#  [1,] "u"  "d" 
#  [2,] "u"  "d" 
#  [3,] "u"  "d" 
#  [4,] "u"  "d" 
#  [5,] "d"  "u" 
#  [6,] "d"  "u" 
#  [7,] "d"  "d" 
#  [8,] "d"  "d" 
#  [9,] "d"  "d" 
# [10,] "d"  "d" 
# [11,] "d"  "d" 
# [12,] "d"  "d" 
# [13,] "d"  "d" 
# [14,] "d"  "d" 
# [15,] "d"  "d" 
kappa2(dat)  # this is the test, you have (non-significant) disagreement
#  Cohen's Kappa for 2 Raters (Weights: unweighted)
# 
#  Subjects = 15 
#    Raters = 2 
#     Kappa = -0.216 
#         z = -0.916 
#   p-value = 0.36 
Source Link
gung - Reinstate Monica
  • 147.5k
  • 89
  • 406
  • 717

The question you are asking is about agreement. You need to think in terms of the format of your second contingency table, because your data are matched in the sense that the observations are of the same genes. The test you want is Cohen's kappa. In R, it could be done like this:

library(irr)  # you need to use this package
dat = matrix(c(rep(c("u", "d"), 4),  # here I input your data
               rep(c("d", "u"), 2),
           rep(c("d", "d"), 9) ), ncol=2, byrow=T)
dat
#       [,1] [,2]
#  [1,] "u"  "d" 
#  [2,] "u"  "d" 
#  [3,] "u"  "d" 
#  [4,] "u"  "d" 
#  [5,] "d"  "u" 
#  [6,] "d"  "u" 
#  [7,] "d"  "d" 
#  [8,] "d"  "d" 
#  [9,] "d"  "d" 
# [10,] "d"  "d" 
# [11,] "d"  "d" 
# [12,] "d"  "d" 
# [13,] "d"  "d" 
# [14,] "d"  "d" 
# [15,] "d"  "d" 
kappa2(dat)  # this is the test, you have (non-significant) disagreement
#  Cohen's Kappa for 2 Raters (Weights: unweighted)
# 
#  Subjects = 15 
#    Raters = 2 
#     Kappa = -0.216 
# 
#         z = -0.916 
#   p-value = 0.36