Summary method for the cross_tabs function

# S3 method for cross_tabs
summary(object, check = "", dec = 2, ...)

Arguments

object

Return value from cross_tabs

check

Show table(s) for variables var1 and var2. "observed" for the observed frequencies table, "expected" for the expected frequencies table (i.e., frequencies that would be expected if the null hypothesis holds), "chi_sq" for the contribution to the overall chi-squared statistic for each cell (i.e., (o - e)^2 / e), "dev_std" for the standardized differences between the observed and expected frequencies (i.e., (o - e) / sqrt(e)), and "dev_perc" for the percentage difference between the observed and expected frequencies (i.e., (o - e) / e)

dec

Number of decimals to show

...

further arguments passed to or from other methods.

Details

See https://radiant-rstats.github.io/docs/basics/cross_tabs.html for an example in Radiant

See also

cross_tabs to calculate results

plot.cross_tabs to plot results

Examples

result <- cross_tabs(newspaper, "Income", "Newspaper") summary(result, check = c("observed", "expected", "chi_sq"))
#> Cross-tabs #> Data : newspaper #> Variables: Income, Newspaper #> Null hyp.: there is no association between Income and Newspaper #> Alt. hyp.: there is an association between Income and Newspaper #> #> Observed: #> Newspaper #> Income WS Journal USA Today Total #> Low Income 83 276 359 #> High Income 180 41 221 #> Total 263 317 580 #> #> Expected: (row total x column total) / total #> Newspaper #> Income WS Journal USA Today Total #> Low Income 162.79 196.21 359.00 #> High Income 100.21 120.79 221.00 #> Total 263.00 317.00 580.00 #> #> Contribution to chi-squared: (o - e)^2 / e #> Newspaper #> Income WS Journal USA Today Total #> Low Income 39.11 32.45 71.55 #> High Income 63.53 52.70 116.23 #> Total 102.63 85.15 187.78 #> #> Chi-squared: 187.783 df(1), p.value < .001 #> #> 0.0 % of cells have expected values below 5