View source: R/conddisp.r View source: R/dsldConditDisparity.R
dsldConditDisparity | R Documentation |
Plots (estimated) mean Y against X, separately for each level of S,
with restrictions condits
. May reveal Simpson's Paradox-like
differences not seen in merely plotting mean Y against X.
dsldConditDisparity(data, yName, sName, xName, condits = NULL,
qeFtn = qeKNN, minS = 50, useLoess = TRUE)
data |
Data frame or equivalent. |
yName |
Name of predicted variable Y. Must be numeric or dichtomous R factor. |
sName |
Name of the sensitive variable S, an R factor |
xName |
Name of a numeric column for the X-axis. |
condits |
An R vector; each component is a character
string for an R logical expression representing a desired
condition involving |
qeFtn |
|
minS |
Minimum size for an S group to be retained in the analysis. |
useLoess |
If TRUE, do loess smoothing on the fitted regression values. |
No value; plot.
N. Matloff, A. Ashok, S. Martha, A. Mittal
data(compas)
# graph probability of recidivism by race given age, among those with at
# most 4 prior convictions and COMPAS decile score at least 6
compas$two_year_recid <- as.numeric(compas$two_year_recid == "Yes")
dsldConditDisparity(compas,"two_year_recid", "race", "age",
c("priors_count <= 4","decile_score>=6"), qeKNN)
dsldConditDisparity(compas,"two_year_recid", "race", "age",
"priors_count == 0", qeGBoost)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.