frequency_table
Generates frequency tables for categorical variables, including cross-tabulations with counts and row percentages when a 'by' column is specified, for association testing.
Instructions
Frequency tables for categorical variables, or a cross-tabulation with counts and row percentages when by is given. Use test_categorical afterwards to test the association.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | Cross-tabulate each variable against this column. | |
| data | Yes | Dataset name in the session. | |
| digits | No | Decimal places for percentages. | |
| weight | No | Sampling weight column; cells become summed weights (population counts) instead of respondent counts. | |
| variables | Yes | Columns to tabulate. | |
| include_na | No | Show a row for missing values. | |
| sort_by_count | No | Order levels by descending frequency. |