[R] Query regarding R 'irr' package 'N.cohen.kappa'

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Thu Jun 16 19:25:58 CEST 2022

R is a fully capable computation environment... you do not have to use any contributed package to implement an algorithm. It may be convenient to rely on such resources, but you must always be aware that such code may not be correct. If you think it is not correct, then you can certainly express your validation calculations in R, and if you share such information with the maintainer of that package then they may either correct their package or suggest what considerations you may have neglected.

However, we participants on this list who happen to use R may or may not know anything about your algorithm... chances are pretty high that we don't. If you express your concerns using a reproducible R code example [1] we might take an interest... but debugging your Excel file is pretty unlikely to be of interest here (in addition to being hard to share... the mailing list strips most attachments). As the Posting Guide says, you really should be corresponding with the package maintainer. [2]

[1] https://cran.r-project.org/web/packages/reprex/vignettes/reprex-dos-and-donts.html
[2] https://cran.r-project.org/web/packages/irr/index.html

On June 16, 2022 2:42:31 AM PDT, Kalaivani Mani <manikalaivani using gmail.com> wrote:
>Dear R-help Team,
>I am from India and have a query on 'N.cohen.kappa' Sample size
>calculations for Cohen's Kappa Statistic. I have calculated manually the
>sample size using the formula mentioned in "Cantor, A. B. (1996)
>Sample-size calculation for Cohen’s kappa. Psychological Methods, 1, 150-
>153". Later came to know that it can be done using the R 'irr' package. I
>got a different number.
>Let us consider the following two situations:
>For situation 1, the sample size is 1370 using R
>Testing H0: kappa = 0.81 vs. HA: kappa> 0.95 given that kappa = 0.95 and
>both raters classify 1.5% of subjects as positive.
>R command used is: N.cohen.kappa(0.015, 0.015, 0.95, 0.81, alpha=0.05,
>power=0.8, twosided=FALSE ).
>But for the same situation, the sample size is much higher by manual
>calculation, which is 8580.
>For situation 2, the sample size is 74 by using R and is matching with the
>manual calculation too.
>Testing H0: kappa = 0.81 vs. HA: kappa> 0.95 given that kappa = 0.95 and
>rater1 classify 40% of subjects and rate2 classify 50% of subjects as
>R command used is: N.cohen.kappa(0.40, 0.50, 0.95, 0.81, alpha=0.05,
>power=0.8, twosided=FALSE ).
>I am attaching both the 'Excel sheet formula-kappa sample size situation1 &
>Why is this so? Please help me to sort this out.
>Looking forward to hearing from you.

Sent from my phone. Please excuse my brevity.

More information about the R-help mailing list