Learn R Programming

mariposa (version 0.7.3)

summary.crosstab: Summary method for crosstab results

Description

Creates a summary object that produces detailed output when printed, including the full cross-tabulation table with cell counts, marginal totals, and the requested percentage breakdowns.

Usage

# S3 method for crosstab
summary(
  object,
  crosstab_table = TRUE,
  percentages = TRUE,
  residuals = FALSE,
  digits = 1,
  ...
)

Value

A summary.crosstab object.

Arguments

object

A crosstab result object.

crosstab_table

Logical. Show the cross-tabulation table? (Default: TRUE)

percentages

Logical. Show the percentage sub-rows inside the table (as requested via the percentages argument of crosstab)? (Default: TRUE)

residuals

Logical. Show the adjusted standardized residual as a sub-row in each cell (SPSS CROSSTABS /CELLS=ASRESID)? After a significant chi_square test, cells with an absolute adjusted residual above roughly 2 are the ones deviating from independence. (Default: FALSE, matching SPSS's opt-in cell display)

digits

Number of decimal places for percentages (Default: 1).

...

Additional arguments (not used).

See Also

crosstab for the main analysis function.

Examples

Run this code
result <- crosstab(survey_data, gender, region)
summary(result)
summary(result, percentages = FALSE)
summary(result, residuals = TRUE)   # which cells drive the association?

Run the code above in your browser using DataLab