Skip to contents

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

Usage

chisqposttest(
  data,
  rows,
  cols,
  counts,
  posthoc = "bonferroni",
  sig = 0.05,
  excl = FALSE,
  exp = FALSE,
  plot = FALSE,
  showResiduals = FALSE,
  showEducational = FALSE,
  showDetailedTables = FALSE,
  residualsCutoff = 2,
  testSelection = "auto",
  exportResults = FALSE,
  clinicalPreset = "custom",
  showClinicalSummary = TRUE,
  showExampleInterpretations = FALSE,
  copyReadySentences = FALSE,
  showAssumptionsCheck = TRUE,
  showGlossary = FALSE,
  colorBlindSafe = FALSE
)

Arguments

data

The data as a data frame.

rows

variable in the rows

cols

variable in the columns

counts

Frequency/weight variable for contingency table data. When specified, the data is treated as already summarized with counts per combination.

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

exportResults

Export comprehensive analysis results to downloadable format for further analysis

clinicalPreset

Pre-configured settings for common clinical scenarios

showClinicalSummary

Display natural-language summary of results for clinical interpretation

showExampleInterpretations

Display example interpretations for significant findings

copyReadySentences

Generate copy-ready sentences for clinical reports

showAssumptionsCheck

Display validation of chi-square test assumptions

showGlossary

Display glossary of statistical terms with clinical interpretations

colorBlindSafe

Use color-blind friendly visualization options

Value

A results object containing:

results$todoa html
results$chisqTablea table
results$assumptionsChecka html
results$clinicalSummarya html
results$educationalOverviewa html
results$weightedDataInfoa html
results$contingencyTablea html
results$residualsAnalysisa html
results$multipleTestingInfoa html
results$posthocTablea table
results$detailedComparisonsa html
results$exportTablea table
results$exampleInterpretationsa html
results$reportSentencesa html
results$glossaryPanela html
results$plotan 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
# }