---
name: audit-grim
description: Runs the policyreplication audit check `grim` (means possible given n (grim and grimmer)). Use when auditing papers cited by U.S. policy documents for this check.
check_id: grim
status: planned
tier: 1
unit: paper
needs: fulltext
cost: cpu
module: Reported-numbers consistency
depends_on: []
---

# Means possible given N (GRIM and GRIMMER)

Checks that a reported mean (GRIM) or standard deviation (GRIMMER) of integer-valued data is arithmetically possible for the reported sample size.

**When it applies:** Papers with tables of means of integer items (Likert scales, counts) and N under about 200 per cell.

## Inputs

- Extracted tables: mean, SD, N, number of items
- Methods text to confirm the scale is integer

## When to run it

Cheap filters, cheapest first. The planner runs the check only on targets that pass them; the rest get a `not_applicable` row.

- Full text held, and tables extracted.
- Field is psychology, education, nursing or clinical medicine (integer scales are common).
- At least one table with a mean, an SD and N under 200 in the same row or column.

Filter as SQL over the audit views (D1):

```sql
SELECT t.paper_id FROM audit_target t JOIN paper_fulltext f USING (paper_id) WHERE f.has_fulltext = 1
```

**Decision-model trigger (Jev).** For cases the filters cannot settle, ask a typed question and run the check when the answer clears the threshold.

| Part | Value |
| --- | --- |
| Input | Methods section |
| Question | Are outcomes measured on integer-valued scales (Likert items, counts) with fewer than 200 participants per group? |
| Answer type | yes / no |
| Run the check if | p(yes) > 0.5 |

Jev is weak at counting, dates and reading numbers literally, so it only decides whether to run the check, never the check's result.

## How to run

Not implemented yet. To build it, register a function with `@check(...)` in `audit/checks.py` style, using the id, tier, unit and needs above, and follow the steps below. Write a `not_applicable` row for every target the check skips.

## Steps

1. Extract means and SDs with their N from tables.
2. Skip composites, weighted means and N too large to test.
3. Test whether some integer total over N rounds to the reported mean, and the GRIMMER condition for the SD.

## Outcomes

| outcome | meaning |
| --- | --- |
| flag | inconsistent |
| pass | consistent |
| not_applicable | nothing testable |

Every result row carries `evidence` (JSON: quotes, values, ids, URLs) so a reviewer can confirm it without rerunning.

## False positives

The wrong N paired with a mean (attrition, item non-response); composite or weighted means. Most published GRIM flags had innocent explanations.

**Precision:** Not measured.

## Prompt to give an agent

```
Run the policyreplication audit check `grim` following audit/skills/grim/SKILL.md
in github.com/Jomanw/policyreplication. Target corpus: sig2025 (change as needed).
Write one result per target to out/results.jsonl in the audit_result shape
(check_id, version, paper_id, citation_id, outcome, value, evidence).
Then report outcome counts and list every fail and flag with its evidence for
human review. Do not publish or contact anyone about a flag.
```

## Rules for agents

- Write a result for every target, including `not_applicable`, so denominators stay honest.
- A flag is a lead for human review, not a finding. Never publish or report a flag that names a paper or its authors until a person has checked it.
- Use only legally obtained full text. Record blocks; never bypass them.
- Avoid paid LLM calls unless the check's tier is 2 and a budget has been set.
