Testing treatment effect on response with Pearson's Chi-squared test or Cochran-Mantel-Haenszel Chi-Squared Test
wrapper_pearsons_test_treatment.Rd
Testing treatment effect on response with Pearson's Chi-squared test or Cochran-Mantel-Haenszel Chi-Squared Test
Usage
wrapper_pearsons_test_treatment(
data,
response_var,
treatment_var,
biomarker_vars = NULL,
strata_vars = NULL,
strat2_var = NULL,
method = "pearson",
variable_names = NULL,
caption = NULL,
print_total = TRUE,
print_non_response = TRUE,
print_pvalues = TRUE,
print_adjpvalues = TRUE
)
Arguments
- data
Data frame.
- response_var
Name of categorical variable defining successes and failures where the first level corresponds to failure and the second level corresponds to success.
- treatment_var
Name of column with treatment information.
- biomarker_vars
Vector with names of categorical biomarkers. When NULL, overall treatment effect is estimated.
- strata_vars
Stratification factors. If defined, then the Cochran-Mantel-Haenszel Chi-Squared Test is applied.
- method
Method 'pearson' or 'fisher' test.
- variable_names
Named vector with variable names. If not supplied, variable names are created by replacing in column names underscores with spaces.
- caption
Caption for the table with results.
- print_total
Logical. Whether to print total number of samples.
- print_pvalues
Logical. Whether to print p-values.
- print_adjpvalues
Logical. Whether to print adjusted p-values.