dx_fishers_exact | R Documentation |
Conducts Fisher's Exact test of independence on a 2x2 confusion matrix derived from binary classification results, assessing the significance of the association between the observed and expected frequencies.
dx_fishers_exact(cm, detail = "full")
cm |
A dx_cm object created by |
detail |
Character specifying the level of detail in the output: "simple" for raw estimate, "full" for detailed estimate including 95% confidence intervals. |
Fisher's Exact Test is used to examine the significance of the association between the variables in a 2x2 contingency table, particularly useful when sample sizes are small. Unlike the chi-square test, it does not rely on large sample distribution approximations and is hence exact. It's especially preferred when the data has small expected frequencies in one or more cells of the table. A low p-value indicates a significant association between the predicted and actual binary classifications.
Depending on the detail
parameter:
- if "simple": a single numeric value representing the p-value of
Fisher's Exact test.
- if "full": a data frame with the Fisher's Exact test result, including
the p-value and method note.
dx_cm()
for creating a 'dx_cm' object.
cm <- dx_cm(dx_heart_failure$predicted, dx_heart_failure$truth,
threshold = 0.3, poslabel = 1
)
simple <- dx_fishers_exact(cm, detail = "simple")
detailed <- dx_fishers_exact(cm)
print(simple)
print(detailed)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.