agentsclimarketplace

Pg regression mediation

Skill Exekiel179/pingouin-psych-stats/skills/pg-regression-mediation

Skill plugin for Claude Code, Codex & other AI agents: small, safety-first Pingouin workflows for psychology statistics — assumption checks, S0–S5 supervision gates, reproducible Python, and APA-style reporting.

Install
npx -y skills add Exekiel179/pingouin-psych-stats --skill pg-regression-mediation

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Run or generate Pingouin code for linear regression, binary logistic regression, and mediation analysis with reproducible reporting.

SKILL.md

2.5 KB, as published. Nobody here has run it

PG Regression Mediation

Use for regression-style questions that Pingouin supports directly.

Load

Read:

  • ../../references/supervision-gates.md
  • ../../references/pingouin-api-quickref.md
  • ../../references/apa-output-template.md if writing results.

Function Choice

  • Continuous outcome, additive linear predictors -> pg.linear_regression.
  • Binary outcome -> pg.logistic_regression with X, y.
  • Single or multiple mediator path model -> pg.mediation_analysis.

Required Inputs

  • Outcome variable and scale.
  • Predictor list.
  • Covariates and whether they are theoretical controls.
  • Binary coding for logistic regression.
  • Mediation paths: x, m, y.
  • Bootstrap count and seed for mediation.

Code Patterns

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)

Reporting

  • Regression: report coefficient, SE, statistic, p, CI, and model R-squared/adjusted R-squared if returned.
  • Logistic: report coefficient and convert to odds ratio when useful with np.exp(coef).
  • Mediation: report total, direct, indirect paths, bootstrap CI, seed, and bootstrap count.

Guardrails

  • Pingouin linear regression is OLS; it is not a mixed model or SEM package.
  • For Pingouin 0.6.1, logistic_regression takes X, y; verify the signature before using examples from older wrappers.
  • Check residual assumptions and influential cases when substantive conclusions depend on them.
  • Do not present mediation as causal unless temporal order, design, and assumptions support it.
  • Do not hide automatic missing-data removal; report effective n.
  • Mediation bootstrap p-values vary with seed and bootstrap count.
  • End result-bearing answers with one compact S0-S5 audit line.

Gives 0 of the 12 instructions most data analysis skills give

Counted across 286 of the 286 authors here whose files we hold, read 2026-08-06

  • use excel formulas instead of hardcoded calculated valuesin 35 of 286, across 7 files
  • match existing template conventions when modifying filesin 35 of 286, across 7 files
  • document sources for all hardcoded valuesin 35 of 286, across 7 files
  • write minimal concise python codein 35 of 286, across 7 files
  • place all assumptions in separate assumption cellsin 32 of 286, across 5 files
  • apply industry-standard color coding to financial modelsin 31 of 286, across 5 files
  • format years as text stringsin 30 of 286, across 3 files
  • recalculate formulas using recalc.py after modificationsin 30 of 286, across 3 files
  • format negative numbers using parenthesesin 30 of 286, across 3 files
  • fix all identified formula errors before finishingin 27 of 286, across 1 file
  • use colorblind-safe palettesin 19 of 286, across 12 files
  • Name tests after the prevented bugin 13 of 286, across 8 files

Said here and by no other author read

  • use pg.linear_regression for continuous outcomes
  • use pg.logistic_regression for binary outcomes
  • use pg.mediation_analysis for mediator path models
  • round results to three decimal places
  • print results using pg.print_table
  • report regression coefficients standard errors and p-values

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.