Skip to content

Box ch. 9 content into numbered divs and callouts - #128

Open
d-morrison wants to merge 6 commits into
mainfrom
claude/ch09-divs
Open

d-morrison wants to merge 6 commits into
mainfrom
claude/ch09-divs

Conversation

@d-morrison

@d-morrison d-morrison commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Part of #77

Before: ch. 9 (measurement bias and "noncausal" diagrams) had 3 definitions and 1 example in numbered divs. The rest of the content sat in plain prose, in speaker notes, or inside the Fine Point and Technical Point callouts, where nothing could be cross-referenced. "Measurement bias" was bolded in the intro before it was defined.

After: 50 numbered boxes:

  • 8 definitions. New ones:

    • independent errors and nondifferential errors (Technical Point 9.1)
    • the graphical classification of errors through the error nodes $U_A$ and $U_Y$
    • recall bias and reverse causation bias

    def-measurement-bias now also covers mismeasured confounders, as Section 9.3 uses the term. def-causal-dag-strict now restates the three Chapter 6 conditions (Technical Point 6.1) and the causal Markov assumption it builds on.

  • 5 propositions, each with a proof:

    • with perfect data, association is causation in Figure 9.2
    • independent nondifferential error preserves a null (Fine Point 9.1)
    • outcome misclassification with perfect specificity scales the risk difference by the sensitivity and leaves the risk ratio unchanged (ours, marked)
    • the front door formula in Figure 9.14 (Fine Point 9.5)
    • adjusting for obesity identifies the effect in Figure 9.14
  • 23 examples. These include a worked version of the pedestrian experiment with hypothetical numbers (ours, marked). They also include edge-by-edge readings of Figures 9.9, 9.10, 9.12 and 9.15–9.19, checked against the book's figures.

  • 14 remarks. One, our own, explains when the graphical error classification and the error-variable definitions of Technical Point 9.1 agree. An example shows a misclassified binary outcome whose error is differential under the Technical Point definition, even though the recorder's lapses ignore treatment.

  • 14 callouts: 7 notes (Technical Point 9.1 and Fine Points 9.1–9.6), 4 warnings and 3 tips. All Fine and Technical Points already had callouts, and Add callouts for Fine and Technical Points mentioned without one #122 added none for ch. 9. As in the ch. 7 PR (Box ch. 7 content into numbered divs and callouts #124), each one now holds a short summary that points to the boxes after it, and the titles are unchanged.

How:

  • Every existing id (def-measurement-error, def-measurement-bias, exm-hepatitis, def-causal-dag-strict) and every ## heading is kept. Ch. 20 links to the 9.3 heading anchor. One ### heading lost its inline $H$ and is now "Hidden Factors Behind Obesity". Nothing links to it.
  • Links to other chapters use ids that exist on main: 07-confounding.qmd#def-backdoor-criterion-ch7, #thm-standardization-ch7, 03-observational-studies.qmd#def-ende and 06-graphical-representation.qmd#def-causal-markov.
  • No crossref div sits inside a callout or .notes. No div title has inline math, and no @ref points forward or sits inside math.
  • Copyright: an 8-gram overlap check of the whole file against pdftotext of the book chapter finds only box titles, section titles and math symbol runs. Several runs that were already on main are reworded too.
  • misclassified is added to inst/WORDLIST.

Checks:

  • quarto render chapters/09-measurement-bias.qmd to html, docx and revealjs succeeds with no warnings, and there are no unresolved ?@ refs. --to latex also succeeds. I could not compile the PDF here because TeX is not installed.
  • The gha check-new-line-breaks and check-informal-definitions checks pass.
  • R spelling finds nothing new beyond the words already flagged on main.
  • Four rounds of adversarial review by a separate Claude (Sonnet) instance covered math, conditions, forward references, closeness to the book and conventions. They raised 20, 16, 16 and 12 findings, and every one was addressed. No new ids collide with ids in other chapters or in open PR branches.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK

claude added 5 commits October 9, 2026 12:42
Part of #77.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Copilot AI balanced review requested due to automatic review settings October 9, 2026 13:17
@d-morrison d-morrison self-assigned this Oct 9, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

…grammar

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK
Copilot AI balanced review requested due to automatic review settings October 9, 2026 13:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copy link
Copy Markdown
Collaborator Author

Response to the Claude review of 13054b9, fixed in 01337f8:

  1. def-causal-dag-strict restatement: fixed. The box now lists the three conditions from Technical Point 6.1 as a numbered list:

    • a missing arrow means no direct effect;
    • every common cause is on the graph;
    • every variable is a cause of its descendants.

    The causal Markov assumption is now stated separately, as the link between the DAG and the data. The strict sense then adds well-defined interventions for every arrow.

  2. Grammar in exm-two-arrows-obesity: fixed. The sentence now reads "...but because they do not accept that ENDE interventions on obesity exist for that effect, the arrow carries no causal meaning for those experts."

  3. Link depth to ch. 7 Fine/Technical Points: deferred, as the review itself suggests. The ch. 7 callouts have no ids, so this PR can only link to the chapter. Open PR Box ch. 7 content into numbered divs and callouts #124 restructures ch. 7, and those callouts stay id-less there too. Giving callouts anchors would be a ch. 7 change, so it does not belong in this PR.

Posted by Claude Code (AI agent) --- not written by a human.


Generated by Claude Code

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Claude finished review — View run


Both prior findings are correctly addressed. The three conditions in the new def-causal-dag-strict text match Technical Point 6.1 verbatim (condition order and wording align with chapters/06-graphical-representation.qmd:147-149), and the causal Markov assumption is now correctly presented as a separate linking assumption ("Suppose also that... links the DAG to the data") rather than folded into the three defining conditions — matching ch. 6's own framing exactly. The grammar fix ("the arrow carries no causal meaning for those experts") removes the double connective and reads cleanly.

I checked the rest of the diff for new issues: the only other change in this range is this same hunk (the git diff --stat confirms only chapters/09-measurement-bias.qmd, 8 insertions / 4 deletions, all within these two hunks). No new crossref, WORDLIST, or macro changes were introduced in this round, so the verification performed in the prior round (div/crossref integrity, math, citations, macros) still stands unchanged for the rest of the file.

No new findings. Both issues raised in the prior review (commit 13054b99) — the Chapter 6 restatement mismatch and the ungrammatical sentence — are fixed in commit 01337f8/67e2ff8 exactly as described, with no new problems introduced.

Verdict

Ready for merge — both outstanding issues from the prior review round are fixed correctly and verified against the Chapter 6 source; no new findings.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "67e2ff87a1df41926156e1d9ffb94d52deab547f",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "chapters/09-measurement-bias.qmd def-causal-dag-strict now quotes the three Technical Point 6.1 conditions verbatim and separates the causal Markov assumption as a linking statement, fixing the prior mismatch.",
  "holistic_assessment": "The grammar fix and definitional restatement resolve both prior blocking findings without touching crossrefs, WORDLIST, or macro usage, so scope and regression risk remain low."
}

Reviewed commit: 01337f8

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

💰 Cost: $0.1714 (review) — run

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://Morrison-Lab.github.io/win/pr-preview/pr-128/

Built to branch gh-pages at 2026-10-09 13:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants