aib_decompose() splits the change in a between-group gap from one
occasion to the next into the prior gap carried forward (and its decay),
a recovery contribution, a retention contribution, and terms for the
difference between all units with a decision and units with decisions at
both occasions. The split is an exact accounting identity on the recorded
data (symmetric weights, Kitagawa 1955). Each step reports units present,
units with a decision, paired units and prior-state cell counts, and flags
empty (supported = FALSE) and sparse (sparse = TRUE) cells.aib_audit() runs aib_decompose() by default (decompose = TRUE) and
gains lag and min_cell arguments.summary() reports the decomposition by step and in total; plot() gains
type = "decomposition".aib_bootstrap() now recomputes every component present in the object:
gap trajectory, cumulative burden, pooled recovery and retention gaps,
the amplification index and the decomposition. Results are in
$bootstrap$intervals, with n_valid counting the replicates in which
each quantity could be estimated. $bootstrap$ci keeps its earlier
layout.aib_simulate() generates two-state Markov panels with group-specific
transition probabilities and observation that can depend on the previous
decision.lag = "scheduled", the new default in
aib_transition() and aib_amplify()). In 0.1.1 a decision was linked to
the unit's previous data row even when an occasion had been skipped, and
rows with a missing current decision were counted in transition
denominators. Results are unchanged for balanced panels without missing
decisions. Use lag = "recorded" to reproduce 0.1.1.aib_bootstrap() uses the reference group stored by the earlier steps
when ref_group = NULL. Previously it fell back to the first group level,
which could differ from the reference used by aib_describe().aib_build() gains a schedule argument. Occasions are mapped to their
position in the schedule, which defaults to all levels of a factor time
(including unused levels) or the sorted unique values otherwise. A
scheduled occasion with no rows is kept, so the occasions on either side
are no longer paired as if consecutive.aib_build() converts character and factor decisions ("0"/"1",
"TRUE"/"FALSE") explicitly. In 0.1.1, character "0" and "1" were silently
turned into NA. Any other value is an error.aib_build() stops on duplicated unit-occasion rows and on missing group
labels, and warns when a unit's group changes over time.
aib_decompose() and aib_bootstrap() stop in that case, because they
follow units over time and need one group per unit.schedule in
aib_build(), lag in aib_transition() and aib_amplify(), and
decompose, lag and min_cell after ... in aib_audit()), so
positional calls valid in 0.1.1 keep working.aib_build() drops unused levels of a factor unit identifier.aib_amplify() returns NA for steps without adjacent pairs, for example
when a scheduled occasion has no rows, instead of failing; the summed
index is NA when no step is estimable.aib_transition() and aib_audit() no longer fail when no unit is in one
prior state (for example, an all-favorable panel). The affected recovery or
retention rates, gaps and index values are NA, and aib_decompose()
keeps every component that does not need the missing rate.aib_amplify() is now described as a contrast between the recovery and
retention gaps. Its documentation, console messages and narratives no
longer state that a nonzero index shows prior decisions driving current
disparity, and the vignette gives an example in which the index is zero
while the gap widens.tests/testthat.R, so the test suite now runs under R CMD check,
with numerical tests of the decomposition.A_t = (p11_ref - p11_group) - (p01_ref - p01_group).
Negative values indicate recovery-driven amplification against the focal
group; positive values indicate retention-driven amplification.sign argument to aib_amplify() with options "mechanism"
(default) and "legacy" for backward compatibility.\dontrun{} replaced with \donttest{} in examples.\value tags to print.aibias and summary.aibias.aib_figures() default path now uses tempdir().Initial CRAN submission.
Core functions: aib_build(), aib_describe(), aib_transition(),
aib_amplify(), aib_adjust(), aib_bootstrap(), aib_audit().
Four plot types via plot.aibias(): trajectory, heatmap, transition,
amplification.
Includes lending_panel synthetic dataset (600 applicants x 6 years,
3 racial groups).
Demo script reproducing all four paper figures:
demo("paper_figures", package = "AIBias").
Removed author surnames from DESCRIPTION to avoid spell check false positives (Barocas, Hardt, Narayanan, Gelbach replaced with neutral citation wording).
Added .gitignore to exclude cran-comments.md from the repository.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.