Module for easily running and reporting Fishers exact tests.
lcdblib.stats.fisher.fisher(table)[source]¶Perform a Fisher’s exact test.
| Parameters: | table (list or tuple, length=4) – The four cells of a 2x2 table: [r1c1, r1c2, r2c1, r2c2] |
|---|---|
| Returns: | |
| Return type: | Tuple of (odds ratio, two-sided pvalue) |
lcdblib.stats.fisher.fisher_tables(table, row_names=['class 1', 'not'], col_names=['class 2', 'not'], title=None)[source]¶Print all tables along with the FET results
lcdblib.stats.fisher.print_2x2_table(table, row_labels=['class 1', 'not'], col_labels=['class 2', 'not'], fmt='%d')[source]¶Prints a table used for Fisher’s exact test. Adds row, column, and grand totals.
| Parameters: |
|
|---|
lcdblib.stats.fisher.print_col_perc_table(table, row_labels=['class 1', 'not'], col_labels=['class 2', 'not'])[source]¶Returns a string form of the table showing column percentages.
| Parameters: |
|
|---|
lcdblib.stats.fisher.print_row_perc_table(table, row_labels=['class 1', 'not'], col_labels=['class 2', 'not'])[source]¶Returns a string form of the table showing row percentages.
| Parameters: |
|
|---|