一键导入
pg-regression-mediation
Run or generate Pingouin code for linear regression, binary logistic regression, and mediation analysis with reproducible reporting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Run or generate Pingouin code for linear regression, binary logistic regression, and mediation analysis with reproducible reporting.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Screen psychology datasets before Pingouin analysis: variable types, missingness, duplicates, long/wide shape, assumption checks, and safer preprocessing.
Run or generate Pingouin code for multivariate comparisons — Hotelling's T-squared test (multivariate_ttest) — plus the multivariate assumption checks box_m (equal covariance) and multivariate_normality, for designs with several dependent variables.
Route psychology statistics requests to the smallest Pingouin workflow. Use when the user asks what analysis to run, gives a psychology design, asks to analyze data with Pingouin, or needs lower-token guidance before code generation.
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.
Run or generate Pingouin code for categorical / contingency-table analyses — chi-square test of independence, McNemar's paired test, 2x2 crosstabs, and chi-square power — for psychology data with nominal variables.
Run or generate Pingouin code for rank-based non-parametric tests — Mann-Whitney U, Wilcoxon signed-rank, Kruskal-Wallis, Friedman, and Cochran Q — when outcomes are ordinal or parametric assumptions fail.
基于 SOC 职业分类
| name | pg-regression-mediation |
| description | Run or generate Pingouin code for linear regression, binary logistic regression, and mediation analysis with reproducible reporting. |
Use for regression-style questions that Pingouin supports directly.
Read:
../../references/supervision-gates.md../../references/pingouin-api-quickref.md../../references/apa-output-template.md if writing results.pg.linear_regression.pg.logistic_regression with X, y.pg.mediation_analysis.x, m, y.Linear regression:
vars_needed = ["outcome", "x1", "x2"]
tmp = df.dropna(subset=vars_needed)
res = pg.linear_regression(tmp[["x1", "x2"]], tmp["outcome"],
add_intercept=True).round(3)
pg.print_table(res)
Logistic regression:
vars_needed = ["binary_outcome", "x1", "x2"]
tmp = df.dropna(subset=vars_needed)
res = pg.logistic_regression(tmp[["x1", "x2"]], tmp["binary_outcome"],
remove_na=False).round(3)
pg.print_table(res)
Mediation:
res = pg.mediation_analysis(data=df, x="x", m="mediator", y="outcome",
covar=["age"], n_boot=5000,
seed=42).round(3)
pg.print_table(res)
np.exp(coef).logistic_regression takes X, y; verify the signature before using examples from older wrappers.