The rx2 table

the_rx2_table(n, alpha = 0.05, direction = "increasing", skip_exact = FALSE)

Arguments

n

the total number of observations

alpha

the nominal level, e.g. 0.05 for 95% CIs

direction

the direction of the success probabilities

skip_exact

If FALSE, skips the exact conditional and mid-P tests for unspecific ordering (often saves calculation time) ("increasing" or "decreasing")

Value

NULL. This function should be called for its printed output.

Examples

the_rx2_table(mills_graubard_1987, skip_exact = TRUE)
#> Method                          Statistic      P-value
#> -------------------------------------------------------
#> Tests for unordered alternatives
#>   Pearson chi-squared         12.082 (df=4)    0.01675
#>   Likelihood ratio             6.202 (df=4)    0.18456
#> Tests for ordered alternatives
#>   Pearson chi-squared         11.988 (chibar)  0.00171
#>   Likelihood ratio             6.103 (chibar)  0.02990
#> Tests for trend in the linear model
#>   Cochran-Armitage             1.352           0.17639
#>   Modified Cochran-Armitage    1.061           0.28868
#>   Mantel-Haenszel              1.352           0.17638
#>   Wald                         0.956           0.33909
#>   Likelihood ratio             1.268 (df=1)    0.26007
#> Testing the fit of the linear model
#>   Pearson goodness-of-fit      7.313 (df=3)    0.06256
#>   Likelihood ratio (deviance)  4.934 (df=3)    0.17672
#> Tests for trend in the logit model
#>   Wald                         1.353           0.17600
#>   Likelihood ratio             1.755 (df=1)    0.18529
#> Testing the fit of the logit model
#>   Pearson goodness-of-fit      5.682 (df=3)    0.12812
#>   Likelihood ratio (deviance)  4.447 (df=3)    0.21704
#> -------------------------------------------------------
#> Method                  Estimate         95% CI           Width
#> ----------------------------------------------------------------
#> Linear model
#>   Cochran-Armitage CI   0.00069    -0.00058 to 0.00196   0.0025
#>   Wald CI               0.00050    -0.00053 to 0.00154   0.0021
#> Logit model
#>   Wald CI               0.22780    -0.10215 to 0.55776   0.6599
#> ----------------------------------------------------------------
the_rx2_table(indredavik_2008, direction = "decreasing", skip_exact = TRUE)
#> Method                          Statistic      P-value
#> -------------------------------------------------------
#> Tests for unordered alternatives
#>   Pearson chi-squared         13.490 (df=4)    0.00912
#>   Likelihood ratio            14.625 (df=4)    0.00555
#> Tests for ordered alternatives
#>   Pearson chi-squared          9.509 (chibar)  0.00571
#>   Likelihood ratio            11.192 (chibar)  0.00252
#> Tests for trend in the linear model
#>   Cochran-Armitage            -1.788           0.07381
#>   Modified Cochran-Armitage   -1.894           0.05820
#>   Mantel-Haenszel             -1.790           0.07351
#>   Wald                        -2.170           0.03003
#>   Likelihood ratio             3.858 (df=1)    0.04952
#> Testing the fit of the linear model
#>   Pearson goodness-of-fit     11.470 (df=3)    0.00944
#>   Likelihood ratio (deviance) 10.767 (df=3)    0.01305
#> Tests for trend in the logit model
#>   Wald                        -1.777           0.07549
#>   Likelihood ratio             3.124 (df=1)    0.07715
#> Testing the fit of the logit model
#>   Pearson goodness-of-fit     11.889 (df=3)    0.00777
#>   Likelihood ratio (deviance) 11.501 (df=3)    0.00930
#> -------------------------------------------------------
#> Method                  Estimate         95% CI           Width
#> ----------------------------------------------------------------
#> Linear model
#>   Cochran-Armitage CI   -0.01942    -0.03952 to 0.00067   0.0402
#>   Wald CI               -0.02405    -0.04578 to -0.00232   0.0435
#> Logit model
#>   Wald CI               -0.18280    -0.38436 to 0.01877   0.4031
#> ----------------------------------------------------------------