Skip to content

Box ch. 2 content into numbered divs and callouts - #123

Open
d-morrison wants to merge 7 commits into
mainfrom
claude/ch02-divs
Open

d-morrison wants to merge 7 commits into
mainfrom
claude/ch02-divs

Conversation

@d-morrison

Copy link
Copy Markdown
Collaborator

Requested by Ezra · project thread

Part of #77

Before: ch. 2 had 5 definition divs and no numbered results, examples or remarks. Its Technical Points 2.1-2.3 and Fine Points 2.1-2.2 were callouts that mixed definitions, results and proofs, so none of them could be cross-referenced.

After: 17 definitions, 13 propositions (each with a proof), 27 examples and 4 remarks, plus 5 warning callouts, 2 tip callouts and 1 note callout.

  • Definitions: experiment, ideal randomized experiment, full and mean exchangeability, crossover experiment, marginal and conditional randomization, positivity, MCAR/MAR, stratification, risk period, IP weighted mean and pseudo-population. Each new definition comes before its first use and is followed by an example.
  • Results: association is causation under exchangeability, within a stratum too; under exchangeability, association signals an average effect; what each randomized design guarantees; when a crossover experiment reveals an individual effect; MAR is conditional randomization (with a support condition the book's margin note omits, and a counterexample); standardization identifies the counterfactual mean; the properties of the pseudo-population; IP weighting equals standardization and identifies the counterfactual mean.
  • Book boxes: Technical Points 2.1-2.3 and Fine Points 2.1-2.2 are split into these divs, and each div title names its source box, as in the ch. 5 and ch. 6 PRs.
  • Ids: existing ids (def-exchangeability, def-conditional-exchangeability, def-identification, def-standardization, def-ip-weights) are kept, because ch. 12 and ch. 17 link to them. New ids that could collide take a -ch2 suffix (def-stratification-ch2, def-positivity-ch2, def-pseudo-population-ch2, prp-pseudo-population-ch2). def-ip-weights still duplicates ch. 12's id until Fix duplicate crossref id #def-ip-weights (chapter 12) #114 merges.

How:

  • Each boxed statement states its own conditions: dichotomous variables, consistency, exchangeability, positivity, and finite means.
  • Two claims are corrected and marked as the notes' own:
    • An effect in some individuals does not by itself create an association.
    • MAR implies conditional randomization only under a support condition.
  • Statements and numbers were checked against the book PDF: Tables 1.1, 2.1 and 2.2, and the page cites. Section 2.2's page range is now pp. 17-19.
  • Prose is in our own words. An 8-gram overlap check against the book's ch. 2 text now finds only names, dates and the FRCISTG expansion.
  • No theorem div sits inside a callout, .notes block or another div.

Checks:

  • quarto render chapters/02-randomized-experiments.qmd succeeds for html, docx and revealjs, with no warnings and no unresolved ?@ references. --to latex also succeeds. The PDF could not be compiled locally because TinyTeX is not installed in this container.
  • The gha semantic-line-break check passes on the added lines.
  • R spelling finds no new words beyond those already flagged on main, which come from math macros and names.
  • Four rounds of adversarial review by a separate Claude (Sonnet) reviewer were run, and every finding was addressed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gh7L9vJhwrpvpBhzYMdjPK


Generated by Claude Code

claude added 6 commits October 9, 2026 10:54
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
…ed paraphrases

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 11:41
@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.

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 11:52

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

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

Claude finished review — View run


The title change accurately reflects the content (plugging the random variables $A,L$ into $f[a\mid l]$ to get $f[A\mid L]$). This is a minimal, correctly-scoped fix for a real PDF-build break caused by math in a heading, and it doesn't introduce any new cross-reference, macro, or math-correctness issues — the body text and crossrefs are untouched.

I checked whether other remark/div titles in the file still contain inline math (which would risk the same PDF build failure), and found none in this chapter's titles — this was the only offending heading. No other part of the diff changed since the prior round (08dfa0ff..e4e5296a touches only this one line per git diff --stat), and the prior round's full review (cross-reference integrity, div structure, macro usage, math correctness, lab-manual conventions, citations) already covered everything else in the file with no blocking findings.

Verdict

Ready for merge — the only change since the previously reviewed commit (08dfa0ff → e4e5296a) is a one-line title fix (chapters/02-randomized-experiments.qmd:1082) that removes inline math from a rem-ip-weight-notation heading to fix a PDF build break; the new title is accurate and no other content changed. The prior round's verdict (comment, posted 2026-10-09T11:48:28Z, commit 08dfa0ff) found no blocking issues across the full diff, and that assessment still stands.

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "e4e5296a6c225a860810dde1fb29cdbbb8ce047b",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "The only change since the last reviewed commit is a one-line heading edit in chapters/02-randomized-experiments.qmd removing inline math from the rem-ip-weight-notation title to fix a PDF build failure, and the replacement wording remains accurate to the surrounding proof text.",
  "holistic_assessment": "This single-line title fix introduces no cross-reference, macro, or scope regressions, and the previously reviewed structural, mathematical, and lab-manual compliance checks across the rest of the chapter remain valid and unaffected."
}

Reviewed commit: 4089220

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown

💰 Cost: $0.1611 (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-123/

Built to branch gh-pages at 2026-10-09 12:17 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