chi.sq: Simplified Chi Square

View source: R/chi.sq.R

chi.sqR Documentation

Simplified Chi Square

Description

This function simplifies the call for Pearson's Chi Square test (chi.sq) on a given data frame.

Usage

chi.sq(df, var1, var2, correct = FALSE, post = FALSE)

Arguments

df

data frame to read in.

var1

the dependent/outcome variable, Y.

var2

the main independent/predictor variable, X.

correct

logical (default set to F). When set to correct = T, will employ Yates' continuity correction (for data that violate the normality assumption).

post

logical (default set to F). When set to post = T, will return results of post-hoc (Z) tests using Bonferroni's alpha adjustment.

Value

This function returns the summary results table for a Pearson's Chi Square test, examining the relationship between var1 from data frame df, and var2.

Examples

data <- mtcars

chi.sq(data,vs,am)

vannstats documentation built on April 15, 2023, 9:09 a.m.