You can install the latest version of this modifiedfisher
package by
using devtools
:
devtools::install_github("pvdmeulen/modifiedfisher")
The modified Fisher Exact Test (see more information below) can be
called using the modified_fisher_exact_test()
function:
library(modifiedfisher)
modified_fisher_exact_test(u = 5, m = 12, v = 7, n = 11, odds_ratio = 1, alpha = 0.05)
#>
#> Non-Conservative Size-α Modified Fisher's Exact Test
#>
#> data: u = 5, v = 7, m = 12, n = 11
#> p-value = 0.3208
#> alternative hypothesis: true odds ratio is not equal to 1
#> 95 percent confidence interval:
#> 0.072034 2.209549
#> sample estimates:
#> odds ratio
#> 0.4081633
The above example uses local_size_data
argument to TRUE
, and using the resulting local size dataframe to
construct the plot:
test_result <- modified_fisher_exact_test(u = 5, m = 12, v = 7, n = 11, odds_ratio = 1,
alpha = 0.05, local_size_data = TRUE)
The data is now stored in the test_result$local.size.data
object, with
the first five rows given by:
pi1 | size | method |
---|---|---|
0.00 | 0.0000000 | zoom |
0.01 | 0.0006922 | zoom |
0.02 | 0.0092791 | zoom |
0.03 | 0.0393075 | zoom |
0.04 | 0.1038314 | zoom |
0.05 | 0.2116501 | zoom |
Plotting this leads to a similar plot as Figure 1(a):
- Add brief rationale and explanation of theory
- Implement checks and unit tests
- Document functions in a consistent way with article / SAS macro
- Add randomised Fisher Exact Test option