| Title: | Statistical Auditing and Governance Reporting for Employment AI Systems |
|---|---|
| Description: | Provides statistical auditing, risk documentation, and reporting tools to support AI governance workflows for employment and hiring decision systems. Implements the EEOC four-fifths adverse impact rule (Equal Employment Opportunity Commission, 1978, <https://www.ecfr.gov/current/title-29/subtitle-B/chapter-XIV/part-1607>), NYC Local Law 144 bias audit requirements (New York City, 2023, <https://www.nyc.gov/site/dca/about/automated-employment-decision-tools.page>), and the AI Risk Management Framework checklist items from the National Institute of Standards and Technology (2023, <doi:10.6028/NIST.AI.100-1>). Optionally supports EU AI Act high-risk classification (European Parliament and Council, 2024, <https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX:32024R1689>). The package does not provide legal advice or certify legal compliance; it is a statistical and documentation support tool. |
| Authors: | Subir Hait [aut, cre] (ORCID: <https://orcid.org/0009-0004-9871-9677>) |
| Maintainer: | Subir Hait <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-27 14:31:50 UTC |
| Source: | https://github.com/cran/AIGovernance |
Computes selection rates by group and applies the EEOC Uniform Guidelines 4/5ths (80%) rule to assess adverse impact in employment selection procedures (EEOC, 1978).
The Adverse Impact Ratio (AIR) for each group is:
A group is flagged for adverse impact when .
The function also reports the two-proportion Z-test and Fisher's exact
test p-values as supplementary statistics.
Note: The 4/5ths rule is a rule of thumb, not a bright-line legal standard. Small sample sizes reduce reliability. This function does not provide legal advice.
aigov_adverse_impact(gov, min_n = 30L)aigov_adverse_impact(gov, min_n = 30L)
gov |
An |
min_n |
Integer. Minimum group sample size for a reliable AIR estimate.
Groups below this threshold are flagged with a warning. Default |
The input gov object with gov$results$adverse_impact
appended, a tibble containing:
groupGroup label.
nTotal applicants in group.
n_selectedNumber selected.
selection_rateProportion selected.
AIRAdverse Impact Ratio vs reference group.
fourfifths_flagLogical: TRUE if AIR < 0.80.
z_statTwo-proportion Z statistic.
p_valueTwo-sided p-value from Z test.
fisher_pFisher's exact test p-value.
small_n_flagLogical: TRUE if n < min_n.
Equal Employment Opportunity Commission (1978). Uniform guidelines on employee selection procedures. Federal Register, 43(166), 38295–38309.
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_adverse_impact(gov) gov$results$adverse_impactdata(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_adverse_impact(gov) gov$results$adverse_impact
Implements a structured checklist audit aligned with the NIST AI Risk Management Framework (AI RMF 1.0, NIST, 2023). The RMF organises AI risk management into four core functions: GOVERN, MAP, MEASURE, and MANAGE.
This function presents the checklist items most relevant to employment AI
systems and records user-supplied responses (or defaults to NA
for items that cannot be verified from data alone).
aigov_audit_nist(gov, responses = list())aigov_audit_nist(gov, responses = list())
gov |
An |
responses |
An optional named list of logical values ( |
The input gov object with gov$results$nist_rmf
appended, containing:
checklistNamed list with TRUE/FALSE/NA
per item.
scoresPer-function completion scores (proportion of confirmed items).
overall_scoreOverall confirmed proportion.
verdictOne of "GREEN" (>= 0.75), "AMBER"
(0.50–0.74), or "RED" (< 0.50).
National Institute of Standards and Technology (2023). Artificial Intelligence Risk Management Framework (AI RMF 1.0). NIST AI 100-1. doi:10.6028/NIST.AI.100-1
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_audit_nist(gov, responses = list( GOVERN_1_1 = TRUE, GOVERN_1_2 = TRUE, MAP_1_1 = TRUE ))data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_audit_nist(gov, responses = list( GOVERN_1_1 = TRUE, GOVERN_1_2 = TRUE, MAP_1_1 = TRUE ))
Implements the statistical components of a NYC Local Law 144 (2023) bias audit for Automated Employment Decision Tools (AEDTs). The law requires employers using AEDTs to:
Conduct an annual independent bias audit.
Publish a summary of audit results on their website.
Provide advance notice to candidates/employees.
This function computes the required impact ratio statistics for each race/ethnicity and sex category and generates a publication-ready summary table matching the format expected in public disclosures.
The NYC LL144 impact ratio is:
Note: LL144 uses the most-selected category (not a user-specified reference group) as the denominator – this differs from the EEOC approach. This function implements both.
aigov_audit_nyc(gov, use_most_selected = TRUE)aigov_audit_nyc(gov, use_most_selected = TRUE)
gov |
An |
use_most_selected |
Logical. If |
The input gov object with gov$results$nyc_ll144
appended, containing:
impact_tableTibble with selection rates and impact ratios.
most_selected_groupThe reference category used.
disclosure_tableFormatted table for public disclosure.
checklistLL144 procedural checklist (named logical vector).
verdictStatistical verdict: "PASS" or "REVIEW".
New York City Local Law 144 of 2021 (effective January 1, 2023). NYC Department of Consumer and Worker Protection (DCWP). https://www.nyc.gov/site/dca/about/automated-employment-decision-tools.page
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White", frameworks = c("NYC_LL144")) gov <- aigov_audit_nyc(gov)data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White", frameworks = c("NYC_LL144")) gov <- aigov_audit_nyc(gov)
Constructs an aigov object from employment decision data. This is the
entry point for all auditing, classification, and reporting functions in the
AIGovernance package.
Disclaimer: AIGovernance provides statistical and documentation support tools only. It does not provide legal advice and does not certify compliance with any law or regulation.
aigov_build( data, outcome, group, ref_group, frameworks = c("EEOC", "NYC_LL144", "NIST_RMF"), org_name = NULL, system_name = NULL, audit_date = NULL )aigov_build( data, outcome, group, ref_group, frameworks = c("EEOC", "NYC_LL144", "NIST_RMF"), org_name = NULL, system_name = NULL, audit_date = NULL )
data |
A data frame containing the employment decision records. |
outcome |
Unquoted column name of the binary decision variable (1 = selected / hired / advanced; 0 = not selected). |
group |
Unquoted column name of the protected-class variable (e.g., race/ethnicity, gender). |
ref_group |
Character string identifying the reference group (typically
the highest-selection-rate group, e.g. |
frameworks |
Character vector of governance frameworks to activate.
One or more of |
org_name |
Optional character string — organisation name for reports. |
system_name |
Optional character string — name of the AI system being
audited (e.g., |
audit_date |
Optional |
An object of class "aigov" containing:
dataThe input data frame.
outcomeName of the outcome column (character).
groupName of the group column (character).
ref_groupReference group label.
frameworksActive frameworks.
org_nameOrganisation name.
system_nameAI system name.
audit_dateAudit date.
group_levelsAll observed group labels.
n_totalTotal number of records.
data(hiring_sim) gov <- aigov_build( data = hiring_sim, outcome = selected, group = race_ethnicity, ref_group = "White", frameworks = c("EEOC", "NYC_LL144", "NIST_RMF"), org_name = "Acme Corp", system_name = "Resume Screening Tool v1.0" ) print(gov)data(hiring_sim) gov <- aigov_build( data = hiring_sim, outcome = selected, group = race_ethnicity, ref_group = "White", frameworks = c("EEOC", "NYC_LL144", "NIST_RMF"), org_name = "Acme Corp", system_name = "Resume Screening Tool v1.0" ) print(gov)
Returns all checklist item names and descriptions for a given framework.
Use the returned item names as keys in the responses argument of
aigov_audit_nist.
aigov_checklist(gov, framework)aigov_checklist(gov, framework)
gov |
An |
framework |
Character. One of |
A tibble with columns item_id, function_area,
and description.
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") aigov_checklist(gov, "NYC_LL144") aigov_checklist(gov, "NIST_RMF")data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") aigov_checklist(gov, "NYC_LL144") aigov_checklist(gov, "NIST_RMF")
Classifies the AI system under two frameworks:
EU AI Act (2024) – Assigns one of four risk tiers: Unacceptable, High, Limited, or Minimal risk. Employment/worker-management AI is listed in Annex III as High Risk.
NIST AI RMF – Assigns a risk tier (1–4) based on impact on individuals' rights and opportunities.
aigov_classify( gov, domain = "employment", makes_final_decision = TRUE, human_oversight = NA )aigov_classify( gov, domain = "employment", makes_final_decision = TRUE, human_oversight = NA )
gov |
An |
domain |
Character. Application domain. One of |
makes_final_decision |
Logical. Does the AI system make or
substantially influence a final employment decision? Default |
human_oversight |
Logical. Is meaningful human review in place before
the AI decision takes effect? Default |
The input gov object with gov$results$risk_class
appended, containing EU AI Act and NIST risk classifications with
explanatory text.
European Parliament and Council (2024). Regulation (EU) 2024/1689 (EU AI Act). https://digital-strategy.ec.europa.eu/en/policies/regulatory-framework-ai
NIST (2023). AI RMF 1.0. doi:10.6028/NIST.AI.100-1
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_classify(gov, domain = "employment", makes_final_decision = TRUE, human_oversight = FALSE)data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_classify(gov, domain = "employment", makes_final_decision = TRUE, human_oversight = FALSE)
Produces a self-contained HTML (or plain-text) governance audit report
from a completed aigov object. The report is suitable for internal
documentation, legal review, or public disclosure (e.g., NYC LL144 website
posting requirement).
aigov_report(gov, format = "html", output_file = NULL, open = TRUE)aigov_report(gov, format = "html", output_file = NULL, open = TRUE)
gov |
A completed |
format |
Character. Output format: |
output_file |
Optional character. File path for the output. If
|
open |
Logical. If |
Invisibly returns the path to the generated file.
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_adverse_impact(gov) gov <- aigov_audit_nyc(gov) gov <- aigov_audit_nist(gov) aigov_report(gov, format = "html")data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") gov <- aigov_adverse_impact(gov) gov <- aigov_audit_nyc(gov) gov <- aigov_audit_nist(gov) aigov_report(gov, format = "html")
Returns a summary of which governance frameworks apply to the AI system
described in the aigov object, based on domain and jurisdiction.
aigov_scope(gov, domain = "employment", us_state = NULL)aigov_scope(gov, domain = "employment", us_state = NULL)
gov |
An |
domain |
Character. Application domain (default |
us_state |
Optional character. US state, e.g. |
A tibble with columns framework, applies,
jurisdiction, and note.
data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") aigov_scope(gov, domain = "employment", us_state = "NY")data(hiring_sim) gov <- aigov_build(hiring_sim, selected, race_ethnicity, ref_group = "White") aigov_scope(gov, domain = "employment", us_state = "NY")
A synthetic dataset of 500 job applicants processed by a hypothetical automated resume-screening tool. Generated for illustrative and testing purposes only. All individuals are fictional.
hiring_simhiring_sim
A data frame with 500 rows and 6 variables:
applicant_idInteger applicant identifier.
race_ethnicityCharacter. One of "White",
"Black", "Hispanic", "Asian", "Other".
genderCharacter. "Male" or "Female".
years_experienceNumeric. Years of relevant experience.
scoreNumeric. AI screening score (0–100).
selectedInteger (0/1). Whether the applicant was advanced to the next stage (1 = selected, 0 = not selected).
Selection probabilities were set to produce a realistic adverse impact pattern across race/ethnicity groups, consistent with published empirical ranges. The data are purely synthetic and do not represent any real organisation or hiring process.
Simulated by the package authors for illustration purposes.
data(hiring_sim) head(hiring_sim) table(hiring_sim$race_ethnicity, hiring_sim$selected)data(hiring_sim) head(hiring_sim) table(hiring_sim$race_ethnicity, hiring_sim$selected)