The 1xc table tests
the_1xc_table_tests(n, pi0, chacko.test = FALSE)
NULL. This function should be called for its printed output
# Genotype counts for SNP rs 6498169 in RA patients
the_1xc_table_tests(n = snp6498169$complete$n, pi0 = snp6498169$complete$pi0)
#> Estimate of pi_1: 276 / 774 = 0.357 (pi_1,0 = 0.402)
#> Estimate of pi_2: 380 / 774 = 0.491 (pi_2,0 = 0.479)
#> Estimate of pi_3: 118 / 774 = 0.152 (pi_3,0 = 0.119)
#> Method P-value (test statistic)
#> ---------------------------------------------------
#> Pearson chi-squared 0.0032 (T = 11.481, df = 2)
#> Likelihood ratio 0.0040 (T = 11.038, df = 2)
#> ---------------------------------------------------
# subset of 10 patients
the_1xc_table_tests(n = snp6498169$subset$n, pi0 = snp6498169$subset$pi0)
#> Estimate of pi_1: 6 / 10 = 0.600 (pi_1,0 = 0.402)
#> Estimate of pi_2: 1 / 10 = 0.100 (pi_2,0 = 0.479)
#> Estimate of pi_3: 3 / 10 = 0.300 (pi_3,0 = 0.119)
#> Method P-value (test statistic)
#> ---------------------------------------------------
#> Pearson chi-squared 0.0346 (T = 6.727, df = 2)
#> Likelihood ratio 0.0270 (T = 7.221, df = 2)
#> Exact multinomial 0.0479
#>
#> Mid-P multinomial 0.0465
#>
#> ---------------------------------------------------
# Example for the Chacko test: Hypothetical experiment
the_1xc_table_tests(n = hypothetical, pi0 = c(0.402, 0.479, 0.119), TRUE)
#> The Chacko test: P = 0.002168, T = 12.268 (df = 2)