Learn R Programming

exact2x2 (version 1.7.0)

Exact Tests and Confidence Intervals for 2x2 Tables

Description

Calculates conditional exact tests (Fisher's exact test, Blaker's exact test, or exact McNemar's test) and unconditional exact tests (including score-based tests on differences in proportions, ratios of proportions, and odds ratios, and Boshcloo's test) with appropriate matching confidence intervals, and provides power and sample size calculations. Gives melded confidence intervals for the binomial case (Fay, et al, 2015, ). Gives boundary-optimized rejection region test (Gabriel, et al, 2018, ), an unconditional exact test for the situation where the controls are all expected to fail. Gives confidence intervals compatible with exact McNemar's or sign tests (Fay and Lumbard, 2021, ). For review of these kinds of exact tests see Fay and Hunsberger (2021, ).

Copy Link

Version

Install

install.packages('exact2x2')

Monthly Downloads

1,984

Version

1.7.0

License

GPL-3

Maintainer

Michael Fay

Last Published

August 20th, 2025

Functions in exact2x2 (1.7.0)

mcnemarExactDP

Exact McNemar (Paired Binary) Test with Difference in Proportions
pickTstat

Pick T statistic (ordering function) for unconditional exact test.
uncondExact2x2-internal

Internal functions for unconditional exact tests.
power2grid

Create grid for root search.
plotT

Plot or Print ordering function for unconditional exact test
power2x2

Calculate exact power or sample size for conditional tests for two independent binomials.
exact2x2Plot

Plot p-value function for one 2 by 2 table.
ucControl

Algorithm variables used by uncondExact2x2.
uncondPower2x2

Calculate power or sample size for any 2x2 test.
unirootGrid

Function to find a root by grid search.
uncondExact2x2

Unconditional exact tests for 2x2 tables
powerPaired2x2

Power for exact McNemar's test
boschloo

Boschloo's test for 2x2 Tables
borrTest

Boundary-Optimized Rejection Region Test
borrControl

Algorithm variables used by borrTest.
constrMLE.difference

Calculate constrained MLEs.
exact2x2

Exact Conditional Tests for 2 by 2 Tables of Count Data
calcTall

Calculate all Tstat for all values of the (n1+1) X (n2+1) sample space from the two sample binomial problem.
exact2x2-internal

Internal functions for exact2x2. Not to be called by user.
binomMeld.test

Melded Binomial Confidence Intervals and Tests
borrOrderingInternal

BORR Ordering, internal calculation functions
exact2x2-package

Exact Tests and Confidence Intervals for 2x2 Tables