Created
July 1, 2020 03:47
-
-
Save aus10powell/c142369842b08cd78408678597ba0ed9 to your computer and use it in GitHub Desktop.
Pandas Odds-Ratio Display and Test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##################### | |
# 2x2 Contingency table w/ test | |
##################### | |
import stats | |
d = { | |
"flagged": [221, 221], | |
"not-flagged": [2,10], | |
} | |
d_t = pd.DataFrame(d, index=["English", "Non-English"]) | |
display(d_t) | |
oddsratio, pvalue = stats.fisher_exact(d_t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment