Learn R Programming

mKBO (version 0.1.0)

mkbo_summary: Summarize Components of an mKBO Decomposition

Description

Provides a summary of the modified Kitagawa-Blinder-Oaxaca (mKBO) decomposition for selected model terms or grouped categories of terms. This function is useful for inspecting how specific variables (or sets of variables) contribute to the overall decomposition across groups.

Usage

mkbo_summary(x, term = NULL, term.cat = NULL)

Value

A data.frame with one row per group and the following columns:

group

Group identifier (from the grouping variable used in mkbo).

M

Group-specific mean of the outcome variable.

D

Difference from the reference (sample mean), as used in the mKBO decomposition.

R

Total explained difference (sum of E + C + I components).

E

Component of the difference due to endowments (differences in covariates).

C

Component due to coefficients (differences in effects).

I

Interaction component (joint difference in covariates and coefficients, conditional on E and C).

Arguments

x

An object of class "mkbo", as returned by the mkbo function.

term

A character vector specifying one or more model terms (e.g., variable names) for which to summarize decomposition results. Use this argument to inspect contributions from specific variables.

term.cat

A character string specifying a common prefix for a group of terms (typically dummy variables from a factor). This will summarize the decomposition results for all terms that match this pattern (e.g., "education" will match "education.Bachelor", "education.Master", etc.).

Examples

Run this code
mkbo_output <- mkbo("PERNP ~ BACHELOR", group = "RACE", data=pums_subset)
mkbo_summary(mkbo_output, term="BACHELORTRUE")

Run the code above in your browser using DataLab