| aib_adjust | R Documentation |
Estimates covariate-adjusted bias trajectories by fitting a model for
Pr(D_{it} = 1 \mid X_{it}, A_i, t) and computing marginal
predicted disparities by group and time.
aib_adjust(
object,
formula,
method = c("glm", "gam", "mixed"),
ref_group = NULL,
verbose = TRUE
)
object |
An 'aibias' object from [AIBias::aib_build()]. |
formula |
A one-sided formula specifying covariates, e.g. '~ age + income + prior_score'. The group and time variables are added automatically. |
method |
One of '"glm"', '"gam"', or '"mixed"'. - '"glm"': logistic regression - '"gam"': generalized additive model (requires mgcv) - '"mixed"': GLMM with random intercept for id (requires lme4) |
ref_group |
Character. Reference group. |
verbose |
Logical. |
The 'aibias' object with '$adjusted' populated, containing: - 'trajectory': adjusted bias trajectory - 'marginal_rates': marginal predicted rates by group and time - 'model': the fitted model object - 'formula_used': the full formula passed to the model
data(lending_panel)
obj <- aib_build(lending_panel, "applicant_id", "year", "race", "approved")
obj <- aib_adjust(obj, formula = ~ income + credit_score, method = "glm",
ref_group = "White")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.