Learn R Programming

mKBO (version 0.1.0)

mkbo_triangle: Calculates Triangle

Description

This function calculates all group-differences

Usage

mkbo_triangle(
  mkbo_output,
  term = NULL,
  term.cat = NULL,
  components = c("E"),
  percentage = TRUE,
  absolute_gaps = TRUE
)

Value

An object of class tibble, containing absolute or relative group-differences explained by the variables specified in mKBO.

Arguments

mkbo_output

placeholder text

term

Specify the model term for which the mKBO results should be presented. Can be a vector of terms to present the summed results for those terms. Should be specified in quotation marks.

term.cat

Specify a factor variable for which to sum the mKBO results across categories. Should be specified in quotation marks.

components

Specify+he decomposition components to be included in the calculation. Can be any combination of c("E", "C", "I"), or "R".

percentage

Specify to express the changes in gap as percentage (default) or in absolute differences (expressed in unites of the dependent variables).

absolute_gaps

If TRUE, the changes in gaps are expressed in absolute terms even when signs change.

Examples

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

Run the code above in your browser using DataLab