Skip to contents

Estimates labor totals and core rates from the official consolidated ENEMDU condition-of-activity variable. The function first builds labor flags with enemdu_build_labor_flags() and then estimates totals and rates using the package survey-design estimators.

Usage

enemdu_kpi_employment(
  data,
  group_vars = NULL,
  condact = "condact",
  age = "p03",
  sector = "secemp",
  ids = "upm",
  strata = "estrato",
  weight = "fexp",
  survey_type = NULL,
  domain_scope = c("observed", "design"),
  include_totals = TRUE,
  include_rates = TRUE,
  strict = TRUE,
  conf_level = 0.95,
  lonely_psu = "adjust",
  sample_n_min = 60
)

Arguments

data

A data frame.

group_vars

Optional grouping variables.

condact

Condition-of-activity variable. Defaults to "condact".

age

Age variable. Defaults to "p03".

sector

Employment-sector variable. Defaults to "secemp".

ids

Primary sampling unit variable. Defaults to "upm".

strata

Strata variable. Defaults to "estrato".

weight

Expansion factor variable. Defaults to "fexp".

survey_type

Optional ENEMDU survey type.

domain_scope

Domain filtering policy. "observed" returns all observed domains generated by group_vars. "design" estimates with the complete data and then filters the output to recognized ENEMDU design domains for the declared survey_type.

include_totals

Logical. If TRUE, estimates labor-population totals.

include_rates

Logical. If TRUE, estimates core labor rates.

strict

Logical. If TRUE, invalid observed labor codes produce an error.

conf_level

Confidence level.

lonely_psu

Option passed to survey.lonely.psu.

sample_n_min

Minimum unweighted sample size for preliminary quality flag.

Value

A tibble with survey-design employment KPI estimates.

Details

The default domain_scope = "observed" preserves observed grouping values in the output. When domain_scope = "design", estimation still uses the full input microdata and only the output rows are filtered to recognized design domains for registered grouping variables. For official city-domain validation against published tabulations, use dominio when that derived field is available; ciudad is not assumed to be equivalent to the published official city-domain tabulations.