View source: R/aib_transition.R
| aib_transition | R Documentation |
Estimates group-specific Markov transition probabilities
p_g^{ab}(t) = Pr(D_{it} = b \mid D_{i,t-1} = a, A_i = g)
and derives transition disparities, advantage retention, and recovery gaps.
aib_transition(
object,
ref_group = NULL,
verbose = TRUE,
lag = c("scheduled", "recorded")
)
object |
An 'aibias' object from [AIBias::aib_build()]. |
ref_group |
Character. Reference group. If NULL, uses first level. |
verbose |
Logical. Print summary. |
lag |
Character. How a decision is linked to the previous one. '"scheduled"' (default) uses the decision at the immediately preceding scheduled occasion and drops the transition when that occasion has no recorded decision. ‘"recorded"' uses the unit’s previous data row, whatever its occasion; this was the only behavior in AIBias 0.1.1. The two agree on balanced panels without missing decisions. |
The 'aibias' object with '$transitions' populated. Contains:
- 'probs': Transition probabilities by group and time
- 'pooled': Pooled transition probabilities (time-averaged)
- 'disparity': Transition disparity \Delta^{ab}_{g,r}(t)
- 'recovery_gap': Disparity in 0->1 transitions (recovery)
- 'retention_gap': Disparity in 1->1 transitions (retention)
- 'matrices': Named list of 2x2 transition matrices per group
- 'counts': transition counts by group, occasion and prior state
- 'lag': the pairing rule used
When no unit in a group has a given prior state, the corresponding recovery or retention rate and gap are 'NA'.
data(lending_panel)
obj <- aib_build(lending_panel, "applicant_id", "year", "race", "approved")
obj <- aib_transition(obj, ref_group = "White")
obj$transitions$pooled
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.