Skip to contents

Performs Chi-Square test and post-hoc pairwise comparisons.

Usage

chisqposttest(
  data,
  rows,
  cols,
  posthoc = "bonferroni",
  sig = 0.05,
  excl = FALSE,
  exp = FALSE,
  plot = FALSE,
  showResiduals = TRUE,
  showEducational = TRUE,
  showDetailedTables = TRUE,
  residualsCutoff = 2,
  testSelection = "auto"
)

Arguments

data

The data as a data frame.

rows

variable in the rows

cols

variable in the columns

posthoc

Method for p-value adjustment in post-hoc tests

sig

alpha level for significance testing

excl

exclude missing values from analysis

exp

show expected values in the table

plot

display plot of standardized residuals

showResiduals

display standardized residuals analysis with interpretation

showEducational

display educational guidance and explanations

showDetailedTables

display individual 2x2 tables for each pairwise comparison

residualsCutoff

critical value for identifying significant residuals (typically 2.0 or 3.0)

testSelection

method for selecting statistical test for pairwise comparisons

Value

A results object containing:

results$todoa html
results$chisqTablea table
results$educationalOverviewa html
results$contingencyTablea html
results$residualsAnalysisa html
results$multipleTestingInfoa html
results$posthocTablea table
results$detailedComparisonsa html
results$plotOutputan image

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$chisqTable$asDF

as.data.frame(results$chisqTable)

Examples

# \donttest{
# example will be added
# }