This function takes a dataframe and calculates different chi-square statistics. It also prints a summary statement about the findings using effect size definitions from Cohen (1980).

compare_chi_square2(df, group_1, response, response_title = NULL,
  between_lingo, treated_name, untreated_name, .digits = 0, ...,
  verbose = TRUE, extra_word = "", description_case = "title",
  description_text = "", print_log = TRUE, alpha = 0.05,
  description_override = NULL)

Arguments

df

the data frame that you wish to evaluate

group_1

the variable that specifies the grouping variable (typically treated/non-treated)

response

the column name that specifies the response or dependent variable of interest

response_title

wht you wish to name things

between_lingo

the language you want to use to describe the relationship between the two groups

treated_name

the proper name for the treatment group

untreated_name

the proper name for the control group

.digits

number of digits to print

verbose

if you want the sentence print out

extra_word

if need an extra word to make the verbose print out make sense

description_case

what case do you want the text in e.g. title or lower case

description_text

extra descriptive text

print_log

a bolean with default of true that creates a txt file called log_file.txt that includes the outcome. if a file exists the the record will be appended

alpha

the desired frequentist type I error rate with default of 0.05

description_override

allows for over writing the difference for ****.

Value

a vector with the specified capitalisation style

Examples

library(irtools) my_string <- "This IS A STRING with INCONSISTENT caPItals"