transition_matrix
Compute intergenerational mobility transition matrices for education, occupation, or wealth. Returns row percentages, summary statistics, and mobility indices with optional standard errors.
Instructions
Compute an intergenerational mobility transition matrix.
This is the core analysis tool for social mobility research.
Args: dimension: Type of mobility to analyze. - "education": Educational mobility (4x4 matrix). Origin = max(father, mother) education; Destination = respondent education. - "occupation": Occupational class mobility. Origin = father's class; Destination = respondent's class. - "wealth": Wealth quintile mobility (5x5 matrix). Based on PCA wealth index from household assets (origin vs current). filter: Optional filter expression. Examples: "sexo == 2" (women only), "cohorte == 1" (ages 25-34), "region_14 == 5" (Southern region of origin). by: Optional grouping variable to produce separate matrices. Examples: "sexo" (by gender), "region_14" (by region of origin), "cohorte" (by age cohort). origin_category: Optional origin quintile/category to filter. Example: 1 for Q1 (poorest) in wealth, or 1 for "Primaria o menos" in education. Returns only the destination distribution for that origin. include_se: If True, compute Taylor-linearized standard errors and 95% confidence intervals for each matrix cell.
Returns markdown transition matrix with row percentages (origin -> destination), summary statistics, formal mobility indices, and optionally standard errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dimension | No | education | |
| filter | No | ||
| by | No | ||
| origin_category | No | ||
| include_se | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |