Wrapper for _test_2x2 functions on Chapter 4.

the_2x2_table_tests(n, gamma = 1e-04)

Arguments

n

frequency matrix

gamma

parameter for the Berger and Boos procedure

Value

NULL. This function should be called for its printed output

Examples

# Example: A lady tasting a cup of tea
the_2x2_table_tests(tea)
#> H_0: pi_1 = pi_2  vs  H_A: pi_1 = / = pi_2
#> Estimate of pi_1: 3 / 4 = 0.750
#> Estimate of pi_2: 1 / 4 = 0.250
#> 
#> Test                                  P-value  (test statistic)
#> ------------------------------------------------------------------
#> Pearson chi-squared                     0.1573 (T = 2.000, df = 1)
#> Pearson chi-squared w / CC              0.4795 (T = 0.500, df = 1)
#> Likelihood ratio                        0.1480 (T = 2.093, df = 1)
#> Fisher exact test (Fisher-Irwin)        0.4857
#> Fisher exact test (Pearson)             0.4857
#> Fisher exact test (LR)                  0.2571
#> Fisher mid-P test (Fisher-Irwin)        0.2571
#> Suissa-Shuster exact uncond.*           0.2892
#> Exact uncond. w / LR statistic*         0.2267
#> Exact uncond. w / unpooled Z statistic* 0.2892
#> Fisher-Boschloo exact uncond.*          0.2892
#> ------------------------------------------------------------------
#>  * gamma = 0.0001    

# Example: Lampasona et al. (2013)
the_2x2_table_tests(lampasona_2013)
#> H_0: pi_1 = pi_2  vs  H_A: pi_1 = / = pi_2
#> Estimate of pi_1: 9 / 13 = 0.692
#> Estimate of pi_2: 4 / 14 = 0.286
#> 
#> Test                                  P-value  (test statistic)
#> ------------------------------------------------------------------
#> Pearson chi-squared                     0.0346 (T = 4.464, df = 1)
#> Pearson chi-squared w / CC              0.0841 (T = 2.984, df = 1)
#> Likelihood ratio                        0.0321 (T = 4.593, df = 1)
#> Fisher exact test (Fisher-Irwin)        0.0570
#> Fisher exact test (Pearson)             0.0570
#> Fisher exact test (LR)                  0.0570
#> Fisher mid-P test (Fisher-Irwin)        0.0391
#> Suissa-Shuster exact uncond.*           0.0524
#> Exact uncond. w / LR statistic*         0.0556
#> Exact uncond. w / unpooled Z statistic* 0.0460
#> Fisher-Boschloo exact uncond.*          0.0524
#> ------------------------------------------------------------------
#>  * gamma = 0.0001    

if (FALSE) { # \dontrun{
  the_2x2_table_tests(perondi_2004) # Example: Perondi et al. (2004)
  the_2x2_table_tests(ritland_2007) # Example: Ritland et al. (2007)
} # }