chisq_pairwise: Follow-up for contingency table test

View source: R/chisq_followup.R

chisq_pairwiseR Documentation

Follow-up for contingency table test

Description

Follow-up for contingency table test

Usage

chisq_pairwise(
  Xsq,
  population_in_row = TRUE,
  adjust = stats::p.adjust.methods,
  effect_size = c("V", "phi"),
  ci = 0.95,
  ...
)

chisq_residual(
  Xsq,
  adjust = stats::p.adjust.methods,
  res_type = c("pearson", "standardized"),
  ci = 0.95
)

Arguments

Xsq

Result from chisq.test()

population_in_row

Comparisons by row? (If not, by column.)

adjust

Method for correcting p-values. See stats::p.adjust.

effect_size

Type of effect size to use.

ci

Confidence Interval (CI) level

...

Passed to chisq.test().

res_type

Type of residuals to use.

Examples

M <- as.table(rbind(
  c(762, 327, 468),
  c(484, 239, 477)
))
dimnames(M) <- list(
  gender = c("F", "M"),
  party = c("Democrat", "Independent", "Republican")
)
M

res <- chisq.test(M)
chisq_pairwise(res)
chisq_pairwise(res, population_in_row = FALSE)

chisq_residual(res)


mattansb/MSBMisc documentation built on March 22, 2023, 6:02 p.m.