spectredeath/em-cubed/evaluate-p-value

Claude Code and agent skill by spectredeath/em-cubed

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Hybrid inferential skill translating numerically computed p-values into formal hypothesis testing conclusions (reject_null or fail_to_reject_null) under first-order logic rules in Prolog. Supports two-tailed, left-tailed, and right-tailed critical evaluation against significance threshold alpha with human-readable evidence strings and machine-readable state assertions. Use when concluding statistical hypothesis tests, gating decision pipelines on statistical significance, or constructing formal…

Install

npx vskill@latest install spectredeath/em-cubed/evaluate-p-value

SKILL.md

The same SKILL.md was published earlier as spectredeath/em-cubed/evaluate-p-value.

Evaluate P Value Engine

evaluate_p_value translates empirical test $p$-values into formal statistical decisions using first-order logic rules in Prolog combined with Python formatting:

$$\text{Decision} = \begin{cases} \text{reject\_null} & p < \alpha \\ \text{fail\_to\_reject\_null} & p \ge \alpha \end{cases}$$

See CARD.md for the skill summary card, quick-reference tables, and completion criteria checklist.


The 5-Stage P-Value Evaluation Progression

[1. P-Value & Alpha Bound Audit] → [2. Prolog Hypothesis State Routing] → [3. Visual Brief] → [4. Checkpoint] → [5. Formal Evidence String Emit]
Stage 1: P-Value & Alpha Bound Audit
  1. Ingest p_value ($0.0 \le p \le 1.0$) and alpha ($0.0 < \alpha < 1.0$).
  2. Validate tail specification (two, left, right).
Completion criterion: Bounded $p \in [0, 1]$ and valid significance threshold $\alpha$ verified.

Stage 2: Prolog Hypothesis State Routing
  1. Evaluate core threshold predicate in Prolog:

``prolog hypothesis_state(P, Alpha, reject_null) :- P < Alpha. hypothesis_state(P, Alpha, fail_to_reject_null) :- P >= Alpha. ``

  1. For one-tailed tests, adjust comparison probability against the directional boundary.
Completion criterion: Formal decision atom and symbolic state mapped.

Stage 3: The Visual Brief

For borderline p-values ($0.04 < p < 0.06$) or critical hypothesis decisions, generate an interactive brief:

  • Location: Write to %TEMP%\p-value-brief-<timestamp>.html (Windows) or /tmp/p-value-brief-<timestamp>.html (Unix).
  • Styling: Dark theme (#0d1117) using Tailwind CSS and Mermaid.js via CDN.
  • Topology: Render null distribution PDF curve, critical rejection region $\alpha$, and test statistic point marker.
Completion criterion: Visual brief generated with active clickable path returned to caller.

Stage 4: Mandatory Checkpoint

Before finalizing statistical reporting:

  1. Check for alpha-boundary equality ($p = \alpha$). Note that $p = \alpha$ strictly fails to reject $H_0$ ($p \not< \alpha$).
  2. Record whether test was pre-registered or exploratory to guard against p-hacking interpretation.
Completion criterion: Boundary condition evaluated and recorded in diagnostic payload.

Stage 5: Formal Evidence String Emission
  1. Format human-readable narrative string:

$$\text{"At } \alpha = 0.05\text{, reject the null hypothesis } [p = 0.0024]\text{"}$$

  1. Emit complete PValueResult record.
Completion criterion: Formally structured result emitted with decision, state, and narrative.

Surface References

Python Implementation Surface
python
from typing import Dict, Any
def evaluate_p_value(p_value: float, alpha: float = 0.05, tail: str = "two") -> Dict[str, Any]:
if not (0.0 <= p_value <= 1.0):
raise ValueError(f"invalid_p_value: p_value must be in [0, 1], got {p_value}")
if not (0.0 < alpha < 1.0):
raise ValueError(f"invalid_alpha: alpha must be in (0, 1), got {alpha}")
if p_value < alpha:
decision = "reject_null"
state = "rejected"
else:
decision = "fail_to_reject_null"
state = "not_rejected"
action_text = "reject" if decision == "reject_null" else "fail to reject"
evidence_str = f"At α = {alpha}, {action_text} the null hypothesis [p = {p_value:.6f}]."
return {
"p_value": round(p_value, 6),
"alpha": alpha,
"decision": decision,
"state": state,
"evidence_string": evidence_str
}
Prolog Decision Surface
prolog
valid_alpha(A) :- A > 0, A < 1.
hypothesis_state(P, Alpha, reject_null) :- P < Alpha.
hypothesis_state(P, Alpha, fail_to_reject_null) :- P >= Alpha.
formal_conclusion(reject_null, state(rejected), 'Reject H0').
formal_conclusion(fail_to_reject_null, state(not_rejected), 'Fail to reject H0').

Anti-Patterns & Guardrails

  • "Accept the Null Hypothesis" Phrasing — Stating that $H_0$ is "proven" or "accepted" rather than the mathematically correct "fail to reject $H_0$".
  • Boundary Inclusion Error — Incorrectly rejecting $H_0$ when $p = \alpha$. Rejection strictly requires $p < \alpha$.
  • Unbounded Alpha Values — Accepting $\alpha \ge 1.0$ or $\alpha \le 0.0$.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/spectredeath/em-cubed/evaluate-p-value/badge)](https://verified-skill.com/skills/spectredeath/em-cubed/evaluate-p-value)

Something wrong with this skill or its page? Tell us.