compute_rad: Compute risk-adjusted disparate impact estimate for a policy

Description Usage Arguments Value

Description

Compute risk-adjusted disparate impact estimate for a policy

Usage

1
2
3
compute_rad(pol, controls = NULL, base_group = NULL,
  minority_groups = NULL, fit_fn = "logit_coef", down_sample = 1,
  use_speedglm = TRUE, seed = round(stats::runif(1) * 10000), ...)

Arguments

pol

object of class policy

controls

character vector of additional controls to consider in the second-stage model

base_group

(Optional) single group that acts as the pivot/base; by default, if the grouping variable is a factor, set to the first level, otherwise set to the first of sorted unique values

minority_groups

(Optional) groups to compare to the base group; by default, set to every unique value other than the base group

fit_fn

string indicating the rad estimation model/procedure used. *_coef methods use models without interaction between risk and group, and return the coeficient on group membership. *_avg methods will fit more flexible models (possibly with interactions), and compute average ratios across the population. (TODO: better documentation is expected)

down_sample

(Optional) proportion (between 0 and 1) or number (greater than 1) of rows to sample, if down sampling the (test) data; default is 1 (i.e., use all data)

use_speedglm

whether or not to use speedglm, instead of stats::glm, in cases where N > 2P (see details)

seed

random seed to set

...

additional arguments to pass to fit function from rad_control for fine-tuning

Value

tidy data frame with columns

term

the group members considered minority

estimate

log-odds of treatment, relative to base_group (equivalent to logistic regression coefficient)

std.error

coefficient standard errors for *_coef methods; TO BE IMPLEMENTED for *_avg methods (FOR NOW, ALL ZERO)!

statistic/p.value

(for *_coef methods) corresponding values from model fit

ptrt_base/minor

(for *_avg methods) estimated average treatment probability for base/minority groups

method

the method used

controls

features controlled for


jongbinjung/undi documentation built on May 8, 2019, 11:56 p.m.