Exact_cond_midP_unspecific_ordering_rx2: The exact conditional and mid-P tests for unspecific ordering

View source: R/Exact_cond_midP_unspecific_ordering_rx2.R

Exact_cond_midP_unspecific_ordering_rx2R Documentation

The exact conditional and mid-P tests for unspecific ordering

Description

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"

Usage

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_cond_midP_unspecific_ordering_rx2(n, "decreasing", "PearsonCumOR")

ocbe-uio/contingencytables documentation built on March 19, 2024, 4:30 a.m.