calculate_ai: Calculate Adverse Impact Metrics

Description Usage Arguments Value

View source: R/calculate_ai.R

Description

Calculates adverse impact metrics

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
calculate_ai(
  df,
  groupings,
  stage1,
  stage2,
  n_min = 0,
  prop_min = 0,
  only_max = FALSE,
  correct = TRUE
)

Arguments

df

Dataframe with passrate information. Must include columns for each grouping of interest and columns with logicals indicating success at each stage

groupings

Character vector with names of each column containing grouping variables (e.g, race, gender, etc.)

stage1

Unquoted column name of column indicating whether or not a row should be counted in the calculations (i.e., the denominator). Column must be logical.

stage2

Unquoted column name of column indicating whether or not a row should be counted as a 'Pass' in the calculations (i.e., the numerator). Column must be logical.

n_min

Minimum n count for a group to be included in the calculation

prop_min

Minimum percentage for a group to be included in the calculation

only_max

Only calculate adverse impact using the group with the highest selection ratio as the denominator

correct

a logical indicating whether Yates' continuity correction should be applied where possible.

Value

List with two data frames. The first includes all selection ratios, the second includes all adverse impact calculation

Selection.Ratio

Dataframe with selection ratios

Adverse.Impact

Dataframe with adverse impact metrics, including adverse impact ratio, Cohen's H, Z score test of two proportions, Pearson's chi-squared test of proportions, and Fisher's exact


samuelkaminsky/SKTools documentation built on Jan. 2, 2021, 4:06 a.m.