Small Cell Masking Tool for One- & Two-Way Tabular Reports

Provides automated small-cell suppression for one- and two-way frequency tables. Cells falling below a user-defined frequency threshold are masked, with suppression propagated to secondary cells to prevent indirect disclosure. Designed for clinical and health administrative data, the package supports a range of tabular structures and fits into reproducible reporting pipelines, reducing manual review while applying consistent suppression rules across data sharing workflows.


countmaskr

Lifecycle:stable

R-hub

Motivation

The dissemination of aggregate health statistics derived from clinical and administrative data carries an inherent tension between analytic utility and patient confidentiality. When reported frequencies are sufficiently small, individuals within a subgroup may be vulnerable to re-identification — particularly in stratified or cross-tabulated outputs where demographic, geographic, or clinical covariates intersect. Such vulnerabilities have prompted formal regulatory responses, culminating in data use agreement (DUA) obligations codified by federal agencies and clinical research networks alike.

Federal agencies — including the CMS, the AHRQ, the NCI, and the CDC — each maintain formal small-cell suppression requirements as a condition of data access and publication. Clinical research networks similarly enforce these standards: PCORnet® and PEDSnet both require a minimum cell-size threshold of 11 and 5 respectively across all distributed data queries under their respective data sharing agreements.

For studies spanning multiple reporting dimensions — such as stratified demographic breakdowns or multi-site analyses — manually identifying and suppressing all qualifying primary and complementary cells across large tables is a cumbersome and error-prone process. countmaskr automates this workflow end-to-end, enabling patient privacy as well as asists end-users to meet their DUA obligations consistently and in a reproducible manner across institutional data sharing pipelines.

Definitions of small and secondary cells in one dimensional frequency table

Original

Age N
0 - 1 4
2 - 9 71
10 - 19 925
20 - 29 0
30 - 39 0

  • small cell : A cell with a value below defined threshold which requires a suppression. Aka, a primary cell
  • secondary cell : A cell within the contingency table that would suppression to prevent reverse engineering of small(primary) cell through arithmetic operations

Solution

Age N
0 - 1 <11
2 - 9 <80
10 - 19 925
20 - 29 0
30 - 39 0

Installation

You can install countmaskr from GitHub with:

# install.packages("devtools")
devtools::install_github("Query-Fulfillment/countmaskr")

or using pak

# install.packages("pak")
pak::pkg_install("Query-Fulfillment/countmaskr")

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("countmaskr")

0.1.1 by Sahal Master, 6 months ago


https://query-fulfillment.github.io/countmaskr/


Browse source code at https://github.com/cran/countmaskr


Authors: Sahal Master [cre, aut] (ORCID: , Amy Goodwin Davies [aut] (ORCID: , Allison Zelinski [aut] , Qiwei Shen [aut] , Charles Bailey [aut] , Nicole Marchesani [ctb] (ORCID: , Aqsa Khan [ctb] , Rhonda DeCook [ctb]


Documentation:   PDF Manual  


MPL-2.0 license


Imports lifecycle

Depends on dplyr, tibble, tidyr

Suggests knitr, rmarkdown, testthat


See at CRAN