compare_groups
Compare a variable across groups defined by another variable in the ESRU-EMOVI survey. Compute mean, median, or distribution for each group.
Instructions
Compare a variable across groups defined by another variable.
Args: variable: The variable to compare (e.g., 'ingc_pc', 'educ'). group_var: The grouping variable (e.g., 'sexo', 'region', 'cohorte'). metric: Which metric to compute: 'mean', 'median', or 'distribution'. filter: Optional filter expression. dataset: Which dataset to use (default: entrevistado).
Returns a comparison table showing the metric for each group.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variable | Yes | ||
| group_var | Yes | ||
| metric | No | mean | |
| filter | No | ||
| dataset | No | entrevistado |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |