Skip to contents

Usage

enhancedtwowayfrequency(
  data,
  rowVar,
  colVar,
  cellPercent = TRUE,
  rowPercent = FALSE,
  colPercent = FALSE,
  showCounts = TRUE,
  showTotals = TRUE,
  chiSquareTest = TRUE,
  fisherTest = FALSE,
  continuityCorrection = TRUE,
  associationMeasures = TRUE,
  residualAnalysis = FALSE,
  expectedFrequencies = FALSE,
  minimumExpected = 5,
  robustErrorHandling = TRUE,
  showDiagnostics = FALSE,
  detailedOutput = FALSE,
  clinicalInterpretation = TRUE,
  showRecommendations = FALSE,
  bluesky_integration = TRUE,
  comprehensive_output = FALSE,
  heatmapPlot = FALSE,
  mosaicPlot = FALSE,
  percentageDisplay = "percentage"
)

Arguments

data

.

rowVar

.

colVar

.

cellPercent

Display percentages of total sample (BlueSky BSkyTwoWayFrequency feature)

rowPercent

Display row-wise percentages (sum to 100\

colPercentDisplay column-wise percentages (sum to 100\ columns)

showCountsDisplay raw frequency counts in cross-tabulation

showTotalsInclude row and column totals in tables

chiSquareTestPerform Pearson's chi-square test for association

fisherTestPerform Fisher's exact test (recommended for small samples)

continuityCorrectionApply continuity correction for 2x2 tables

associationMeasuresCalculate Cramér's V, Phi coefficient, and other association measures

residualAnalysisCalculate and display standardized residuals for detecting patterns

expectedFrequenciesDisplay expected frequencies under independence assumption

minimumExpectedThreshold for warning about low expected frequencies

robustErrorHandlingUse BlueSky-style error handling with graceful degradation

showDiagnosticsDisplay diagnostic information about computations and assumptions

detailedOutputInclude comprehensive statistical details and interpretations

clinicalInterpretationProvide clinical context and interpretation guidance

showRecommendationsProvide recommendations based on analysis results

bluesky_integrationUse BlueSky R statistical environment features

comprehensive_outputInclude comprehensive statistical details and diagnostics

heatmapPlotCreate heatmap visualization of frequency table

mosaicPlotCreate mosaic plot showing proportional relationships

percentageDisplayFormat for displaying percentage values

A results object containing:

results$instructionsa html
results$observedFrequenciesa table
results$crossTabMatrixa table
results$cellPercentMatrixa table
results$rowPercentMatrixa table
results$colPercentMatrixa table
results$testResultsa table
results$associationMeasuresTablea table
results$assumptionChecka table
results$diagnosticsComputational diagnostics and data quality assessment
results$comprehensiveAnalysisSummaryEnhanced statistical summary with BlueSky integration
results$recommendationsa html
results$clinicalInterpretationGuidea html
results$methodsExplanationa html
results$heatmapPlotan image
results$mosaicPlotan image
results$residualPlotan image
Tables can be converted to data frames with asDF or as.data.frame. For example:results$observedFrequencies$asDFas.data.frame(results$observedFrequencies) Enhanced two-way frequency analysis toolkit with BlueSky integration for comprehensive cross-tabulation analysis. Includes cell, row, and column percentages, statistical tests for association, robust error handling, and clinical interpretation guidance. Perfect for exploring relationships between categorical variables in clinicopathological research.