| Title: | Classification of Sparseness in 2-by-2 Categorical Data |
|---|---|
| Description: | Provides functions for classifying sparseness in 2 x 2 categorical data where one or more cells have zero counts. The classification uses three widely applied summary measures: Risk Difference (RD), Relative Risk (RR), and Odds Ratio (OR). Helps in selecting suitable continuity corrections for zero cells in multi-centre or meta-analysis studies. Also supports sensitivity analysis and can detect phenomena such as Simpson's paradox. The methodology is based on Subbiah and Srinivasan (2008) <doi:10.1016/j.spl.2008.06.023>. |
| Authors: | Subbiah M [aut, cre] |
| Maintainer: | Subbiah M <[email protected]> |
| License: | GPL-2 |
| Version: | 1.0.5 |
| Built: | 2026-05-18 10:29:09 UTC |
| Source: | https://github.com/cran/nose |
Classifies sparseness in 2x2 categorical tables where one or more cells are zero. The classification uses widely applied summary measures and a continuity correction to determine whether a table exhibits mild, moderate, or severe sparseness.
nose.or(nos, cc)nose.or(nos, cc)
nos |
A numeric matrix or data.frame with 4 columns representing counts in a 2x2 table: a (top-left), b (top-right), c (bottom-left), d (bottom-right). Each row corresponds to a separate 2x2 table. |
cc |
Continuity correction factor (numeric, e.g., 0.3) |
A matrix combining the input counts with an extra column indicating the sparseness classification for each table.
# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.or(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.or(tables, cc = 0.3)# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.or(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.or(tables, cc = 0.3)
Classifies sparseness in 2x2 categorical tables where one or more cells are zero. The classification uses widely applied summary measures and a continuity correction to determine whether a table exhibits mild, moderate, or severe sparseness.
nose.rd(nos, cc)nose.rd(nos, cc)
nos |
A numeric matrix or data.frame with 4 columns representing counts in a 2x2 table: a (top-left), b (top-right), c (bottom-left), d (bottom-right). Each row corresponds to a separate 2x2 table. |
cc |
Continuity correction factor (numeric, e.g., 0.3) |
A matrix combining the input counts with an extra column indicating the sparseness classification for each table.
# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.rd(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.rd(tables, cc = 0.3)# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.rd(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.rd(tables, cc = 0.3)
Classifies sparseness in 2x2 categorical tables where one or more cells are zero. The classification uses widely applied summary measures and a continuity correction to determine whether a table exhibits mild, moderate, or severe sparseness.
nose.rr(nos, cc)nose.rr(nos, cc)
nos |
A numeric matrix or data.frame with 4 columns representing counts in a 2x2 table: a (top-left), b (top-right), c (bottom-left), d (bottom-right). Each row corresponds to a separate 2x2 table. |
cc |
Continuity correction factor (numeric, e.g., 0.3) |
A matrix combining the input counts with an extra column indicating the sparseness classification for each table.
# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.rr(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.rr(tables, cc = 0.3)# Simple example: one 2x2 table with a zero cell xx <- matrix(c(0, 3, 2, 5), nrow = 1, byrow = TRUE) nose.rr(xx, cc = 0.3) # Multiple tables example: each row is a separate 2x2 table tables <- matrix(c( 0, 3, 2, 5, 2, 0, 1, 4, 0, 0, 2, 3 ), nrow = 3, byrow = TRUE) nose.rr(tables, cc = 0.3)