← ClaudeAtlas

pg-bayesianlisted

Compute or generate Pingouin Bayes factors for t tests, correlations, and proportions (bayesfactor_ttest, bayesfactor_pearson, bayesfactor_binom), and read the BF10 already returned by pg.ttest and pg.corr.
Exekiel179/pingouin-psych-stats · ★ 0 · Web & Frontend · score 72
Install: claude install-skill Exekiel179/pingouin-psych-stats
# PG Bayesian Use when the user wants Bayesian evidence (Bayes factors) alongside or instead of p-values, e.g. to quantify support for the null. ## Load Read: - `../../references/supervision-gates.md` - `../../references/pingouin-api-quickref.md` - `../../references/apa-output-template.md` if writing results. ## Decision Rules - t test already run -> read the `BF10` column from `pg.ttest(...)`; no extra call needed. - Correlation already run -> read `BF10` from `pg.corr(...)`. - From a t statistic -> `pg.bayesfactor_ttest(t, nx, ny=None, paired=False)`. - From a correlation r and n -> `pg.bayesfactor_pearson(r, n)`. - Proportion vs a chance value -> `pg.bayesfactor_binom(k, n, p)`. ## Required Inputs - For t: the t value, group sizes (nx, ny), paired flag, prior scale r (default 0.707). - For pearson: r and n. - For binom: successes k, trials n, null probability p (default 0.5). ## Code Patterns Bayes factor from a t test (BF10 is also already in the ttest table): ```python tt = pg.ttest(x, y, paired=False) print({"BF10_from_table": float(tt["BF10"].iloc[0])}) bf = pg.bayesfactor_ttest(float(tt["T"].iloc[0]), nx=len(x), ny=len(y)) print({"BF10": round(float(bf), 3)}) ``` Bayes factor for a correlation: ```python bf = pg.bayesfactor_pearson(r=0.30, n=60) print({"BF10": round(float(bf), 3)}) ``` Bayes factor for a proportion: ```python bf = pg.bayesfactor_binom(k=55, n=100, p=0.5) print({"BF10": round(float(bf), 3)}) ``` ## Interpretation BF10 > 1 favors the al