R/Pearson_LR_tests_unspecific_ordering_rx2.R
Pearson_LR_tests_unspecific_ordering_rx2.Rd
The Pearson chi-squared and likelihood ratio tests for unspecific ordering in rx2 tables. Described in Chapter 5 "The Ordered rx2 Table". May also be used for 2xc tables, after flipping rows and columns (i.e. if n is a 2xc table, call this function with n' (the transpose of n) as the first argument).
Pearson_LR_tests_unspecific_ordering_rx2(n, direction)
An object of the contingencytables_result class,
basically a subclass of base::list()
. Use the utils::str()
function
to see the specific elements returned.
# Chapter 5: Alcohol consumption and malformations (Mills and Graubard, 1987)
Pearson_LR_tests_unspecific_ordering_rx2(mills_graubard_1987, "increasing")
#> Pearson chi-squared test: T = 11.988, P = 0.00171
#> Likelihood ratio test: T = 6.103, P = 0.02990
# Chapter 5: Elevated troponin T levels in stroke patients (Indredavik et al., 2008)
Pearson_LR_tests_unspecific_ordering_rx2(indredavik_2008, "decreasing")
#> Pearson chi-squared test: T = 9.509, P = 0.00571
#> Likelihood ratio test: T = 11.192, P = 0.00252
# Chapter 6: Postoperative nausea (Lydersen et al., 2012a)
Pearson_LR_tests_unspecific_ordering_rx2(t(lydersen_2012a), "decreasing")
#> Pearson chi-squared test: T = 3.724, P = 0.07564
#> Likelihood ratio test: T = 3.813, P = 0.07222