Skip to contents

This function conducts chi-square tests with covariates and visualizes the results.

Usage

PlotChiSqCovar(
  Data,
  xVars,
  yVars,
  covars = NULL,
  Relabel = TRUE,
  Ordinal = TRUE
)

Arguments

Data

The dataset containing the variables.

xVars

A character vector of the names of the x-axis categorical variables.

yVars

A character vector of the names of the y-axis categorical variables.

covars

A character vector of the names of covariate variables. Defaults to NULL.

Relabel

Logical indicating whether to relabel the variables based on their labels in the dataset. Defaults to TRUE.

Ordinal

Logical, indicating whether ordinal variables should be included.

Value

A list containing ggplot objects for visualizations and tables of p-values.