summary.ob_decompose {ddecompose}R Documentation

summary method for class "ob_decompose"

Description

Apart from displaying the (detailed) decomposition results with standard errors, summary.ob_decompose() allows to customize the aggregation of the detailed decomposition terms.

Usage

## S3 method for class 'ob_decompose'
summary(
  object,
  ...,
  aggregate_factors = TRUE,
  custom_aggregation = NULL,
  confidence_level = 0.95
)

Arguments

object

an object of class "ob_decompose", usually , a result of a call to [ob_decompose()].

...

other parameters to be passed through to summary function.

aggregate_factors

boolean, if 'TRUE' (default) terms associated with detailed factor levels are aggregated to a single term for every factor variable.

custom_aggregation

list specifying the aggregation of detailed decomposition terms. The parameter 'custom_aggregation' overrides the parameter 'aggregate_factors'. If 'NULL' (default), then either all detailed terms or all terms associated with a single variable are returned.

confidence_level

numeric value between 0 and 1 (default = 0.95) that defines the printed confidence interval.

Value

The function summary.ob_decompose() summarizes the decompositions terms saved in object.

Examples

data("nlys00")
mod1 <- log(wage) ~ age + education + years_worked_civilian +
  years_worked_military + part_time + industry

decompose_results <- ob_decompose(
  formula = mod1,
  data = nlys00,
  group = female,
  reference_0 = TRUE
)

# Print standard errors
summary(decompose_results)

# Aggregate decomposition terms associated with factor levels
summary(decompose_results, aggregate_factors = TRUE)

# custom aggregation of decomposition terms
custom_aggregation <-
  list(
    `Age` = c("age"),
    `Education` = c(
      "education<10 yrs",
      "educationHS grad (diploma)",
      "educationHS grad (GED)",
      "educationSome college",
      "educationBA or equiv. degree",
      "educationMA or equiv. degree",
      "educationPh.D or prof. degree"
    ),
    `Life-time work experience` = c(
      "years_worked_civilian",
      "years_worked_military",
      "part_time"
    ),
    `Industrial sectors` = c(
      "industryManufacturing",
      "industryEducation, Health, Public Admin.",
      "industryOther services"
    )
  )
summary(decompose_results, custom_aggregation = custom_aggregation)


[Package ddecompose version 1.0.0 Index]