The exact conditional and mid-P tests for unspecific ordering. 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).

Described in Chapter 5 "The Ordered rx2 Table"

Exact_cond_midP_unspecific_ordering_rx2(n, direction, statistic = "Pearson")

Arguments

n

the observed counts (an rx2 matrix)

direction

the direction of the success probabilities ("increasing" or "decreasing")

statistic

the Pearson test statistic ("Pearson") or the likelihood ratio test statistic ("LR"). Can also be used for cumulative ORs in 2xc tables with "PearsonCumOR" or "LRCumOR".

Value

An object of the contingencytables_result class, basically a subclass of base::list(). Use the utils::str() function to see the specific elements returned.

Examples

# Chapter 6: Postoperative nausea (Lydersen et al., 2012a)
n <- t(lydersen_2012a)
Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing")
#> Exact conditional test:    P =  0.13439
#> Mid-P test:             midP =  0.12817
Exact_cond_midP_unspecific_ordering_rx2(n, "decreasing", "PearsonCumOR")
#> Exact conditional test:    P =  0.12033
#> Mid-P test:             midP =  0.11851