Split univariate binomial content into new "Measures of Association for Binary Outcomes" chapter#1042
Conversation
- fix broken figure div id fig-fitted-odds-chd (missing #) and wrap all
three fitted-model scale plots in uniform :::{#fig-...} divs with captions
- fix unmatched parenthesis in interaction-derivative line and duplicated
'experiencing CHD' phrase in coefficient-interpretation example
- fix 'wgcs' typo
- rename duplicate crossref id exr-interpret-rr -> exr-interpret-rd and fix
its copy-pasted body text (asks about the risk difference, per its solution)
- cor-odds-neg: pi is the probability, not the odds
- thm-est-odds: the estimand is the per-trial success odds (odds of X_i=1),
not the odds of the sum X=1
- fix unbalanced parentheses and math-mode en-dashes in case-control odds
formulas; remove duplicated 'however'
- fix stray ')' in thm-expit-expressions
- move the RD/RR/OR hypothesis-testing note after fig-rd-rr-or so the
crossref no longer points forward; fix literal 'pi_1=pi_2' to math
- rename duplicate equation label eq-logistic-ror (cor) -> eq-logistic-ror-diff
- fix copy-pasted Hessian block-matrix entry (row 2 should differentiate
by beta_1, not beta_0)
- remove unresolved '[to add: ...]' placeholder
- fix garbled QQ-plot note and state the per-pattern (not total-N)
large-sample condition
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…ubtree (closes #1025) Bare --- renders a visible <hr> in every profile (website, book, PDF), while the slidebreak shortcode only renders in revealjs. The rendered chapter had 248 <hr> elements before this sweep; 8 after (4 navbar dropdown dividers, 4 from shared includes outside this subtree). Mechanical sweep of _subfiles/logistic-regression/*.qmd plus the two include-separators in chapters/logistic-regression.qmd; YAML fences untouched; verified no swaps landed inside code fences. chapters/r-config.qmd (shared by every chapter) still has one bare ---; left out of scope here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…oses #1026) - \blue{} -> \teal{} (13 files, per CLAUDE.md dark-mode color convention) - raw \hat{\Sigma} -> \hS; raw \widehat{SE}(\hat\beta_k) -> \HSE{\hb_k}; \hat\beta_k -> \hb_k in the Wald subfile; \tp{} used consistently in the predicted-probability variance block - raw \hat\pi/\hat\odds/\hat\ror/\hth -> \hprob/\hodds/\hror macros in the 2x2-shortcut, case-control, and OR-reversibility subfiles - \ror argument separators standardized: pipe for event-conditional usage, comma kept for covariate-pattern comparisons per the CLAUDE.md convention - raw \Pr/\text{odds}/\text{log-odds} -> \Prf/\oddsf/\logoddsf in the logit-expit diagram files; raw omega/eta/pi -> \odds/\logodds/\prob macros where the file otherwise uses them - figure/table chunk-option captions converted to :::{#fig-...}/:::{#tbl-...} div syntax (fig-logit, fig-expit-plot, four tbl-beetles-* tables, two diagnostics figures); missing #| code-fold: true added - \eqdef for definitional equalities (Bernoulli PMF, deriv-matrix caption relations, g-computation estimator, HL statistic, residual definitions); per-pattern saturated log-likelihood contribution now defined before use - N vs q reconciled: q = number of distinct covariate patterns throughout GOF and diagnostics, matching Linear-models-overview - design-matrix-column notation disambiguated from per-observation \vx_i in the score-function display; \derivff/\derivf argument-order made uniform in the Hessian matrix row; ##### heading -> #### in thm-deriv-invodds - \text{sign} -> \signt _sec_logistic_summary.qmd deliberately untouched (full rewrite tracked in #1031). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…w finding on #1035) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
- 'above'/'below' content references replaced with @id crossrefs throughout (compare-probs, OR-objections, RR-RD, marginal subtree, bootstrap files); three previously-unlabeled display equations given {#eq-...} labels so they can be cited - forward-pointing segues removed or reworded (predictive-margins x3, marginal-notes collapsibility preview, rem-observed-vs-causal forward citations) - bare 'This' referents given noun phrases (4 sites) - new solutions: {#sol-change-ref-group} proving all three reference-switching identities with annotated steps; {#sol-strat-to-contrast} deriving the stratified-to-contrast parametrization conversion; odds-vs-probability difference computation completed in sol-odds-probs - anonymous nested .solution divs converted to paired {#sol-...} siblings - pi(OC) shorthand introduced with \eqdef at first use instead of after - non-logistic-models section: teaching content moved out of speaker-notes div, first-person register rewritten to book voice, model-structure-vs- fitting-method distinction stated explicitly - 'Meaningless.' verdict expanded to explain why ungrouped residuals have no reference distribution - exercise variable definitions converted to bullet list (exr-link-function-choice); def-conditional-odds defining equation now states \odds(A|B) explicitly; g-computation consistency hypotheses reformatted as a list - bootstrap prose: duplicated definition sentence removed, B harmonized (algorithm box no longer names a specific B; SE caveat extended to match the CI's illustrative-B note) - reader-facing note added where the causal-inference chapter's definitions are previewed ahead of that chapter's position in the book Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
- every previously deferred proof written out in full with per-step
&& \text{(...)} annotations: thm-logit-expit (both directions),
thm-logit-function, thm-expit-expressions (all three forms),
lem-odds-from-logodds, thm-logodds-pi, cor-logodds-logit,
thm-prob-from-logodds, thm-expit-prob-logodds, cor-odds-neg,
cor-deriv-odds, thm-d_odds-d_logodds, cor-deriv-logit,
thm-deriv-invodds ((1-pi)^2 form now derived, not asserted)
- prf-OR-reversible: '[reverse the preceding steps]' replaced with the
explicit mirrored derivation, fully annotated
- new proof for cor-d_pi-d_eta-var via the Bernoulli variance identity,
derived inline with cross-links to the probability chapter
- log-likelihood, score-function, and Hessian derivations fully annotated;
combined product-rule/chain-rule steps split with explicit u-substitution;
score equations now equal dimensioned zero vectors
- dimension underbraces added to score/Hessian equations, the block
matrices, and the full derivative-matrix table; bare \mat{0} entries
now \mathbf{0}_{p x p}
- new #rem-hessian-nsd: -X'DX is negative semi-definite (annotated
||D^{1/2}Xv||^2 argument), the log-likelihood is concave, and with full
column rank strictly concave, so Newton-Raphson converges to the unique
global MLE
- deriv-matrix 'undefined' rationale now names non-invertibility rather
than the same reasoning as the zero-matrix cells
- thm-collapsibility proof: chained steps split (law of total expectation;
then Z independent of A) and the non-collapsible half now cross-references
the RR derivation (new id eq-rr-not-collapsible)
- thm-g-computation-consistency: final combination now a displayed
Slutsky-annotated equation
- OR-objections and WCGS coefficient-interpretation derivations fully
annotated; missing interaction-term substitution added; duplicated
aligned line now carries the substitution through
- three 4-dash separators (missed by the 3-dash sweep in #1034) converted
to slidebreaks
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
… at first use, cite concavity facts, write out deferred marginal-model solutions - split the multiplication-by-zero + additive-identity line and add the missing linearity-of-differentiation line in the coefficient- interpretation derivations - odds(p,a) notation now defined with eqdef at first use and written with the \odds macro throughout (raw omega removed) - rem-hessian-nsd: concavity and global-maximum facts now linked (Wikipedia) and cited [@boyd2004convex] (new bib entry) - wrote out the two 'Left to the reader' marginal-model solutions in _sec_OR_objections.qmd (linear and interaction cases, fully annotated) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
- numeric examples for logit/expit/log-odds (pi=0.75 chain and its inverse), the expit derivative at a fitted beetle dose, the logistic- model OR between adjacent beetle dose levels, the RRD on the OC/MI data, and the RD/RRD reference-switching identities - restored cor-deriv-expit (expit'(eta) = pi(1-pi)) and removed the dead commented-out includes and their orphaned misc/ duplicates - exm-or-inv-MI now demonstrates OR reversibility numerically on the real 2x2 counts instead of re-deriving the symbolic proof; new conditional-OR and or-ratio-ratio examples; disease/exposure OR promoted to def divs - new thm-rare-disease-or-rr (OR = RR x correction factor) with annotated proof and an example connecting the existing spot-checks - GOF: deviance test, Hosmer-Lemeshow wrapped in def/exm divs; LRT properly framed as a nested-model test with def-lrt and a worked WCGS interaction-model comparison - diagnostics: residual definitions wrapped in def divs, WCGS/beetles applications in exm divs (beetles labeled as the lack-of-fit counterexample); new def-leverage-glm and def-cooks-distance-glm with cross-links to the linear-model chapter - intercept extrapolation caveats added at both interpretation sites (cohort is 39-59; centering noted as the remedy) - bootstrap algorithm wrapped in def-bootstrap-marginal-rd - anthers fitted-model plots added (log vs logit link), fulfilling the placeholder removed in #1033 (requested by review there) - thm-est-se-logodds / thm-est-se-diff-logodds restructured per thm->proof->example with numeric beetle instantiations All quoted values computed from the real data via inline R. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…n the marginal-model solutions - law-of-total-expectation and model-substitution now separate lines (interaction case, matching the sibling solution) - factor-out and substitute now separate lines with the intermediate factored form shown - linearity-of-differentiation lines added before both term-by-term derivative evaluations Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…fter #1033 squash-merge)
…fter #1033 squash-merge)
…1030) - nine new bib entries: hosmer1980goodness, pregibon1981logistic, efron1979bootstrap, efron1993introduction, greenland1986identifiability, greenland1999confounding, hosmer1997comparison, davison1997bootstrap, roach2015combined (all metadata verified; citeproc-checked) - GOF: Dobson guideline cited with chapter-level locator (page not verifiable from this sandbox, per the page-verification rule); Hosmer-Lemeshow 1980 plaintext -> @citekey; AIC/BIC source citations added alongside the existing cross-chapter links; new binning- sensitivity caveat on the HL test citing hosmer1997comparison - diagnostics: Pregibon 1981 framing added for the residual/leverage machinery - bootstrap: Efron 1979 / Efron & Tibshirani 1993 foundational cites; refit-and-restandardize practice cited; replicate-count rule of thumb hedged and sourced (davison1997bootstrap) - collapsibility: Greenland & Robins 1986 and Greenland, Robins & Pearl 1999 added alongside hernan2020causal - randomization => exchangeability+positivity claim cited [@hernan2020causal, Chapters 2-3] - case/control terminology cited to @me4 chapters; bare Springer link -> @vittinghoff2e [Section 8.1.4]; early-OC historical claim recast with a verifiable source (roach2015combined) - @sec-CC-studies cross-link added in the marginal-considerations bullet Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
- new sections: general MLE machinery (estimating equation, Hessian, Newton-Raphson, concavity), Wald tests and CIs, ORs in study designs, model fit and comparison (deviance/HL/AIC-BIC/LRT), residual-based diagnostics (residuals, leverage, Cook's distance), and the full marginal-risks subtree (conditional predicted risk/RD/RR, observed vs causal marginal risk, g-computation, predictive margins, bootstrap, collapsibility) - score-function notation reconciled with the body derivation (eps/veps, not devn); every restated formula matched against the body (q-vs-N df, dimensioned zero vectors, signt, eqdef) - every entry now cross-references its defining div (98 crossrefs, all script-verified against the chapter include tree) - dimension underbraces on all matrix expressions Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
- {{< slidebreak >}} added before thm-rare-disease-or-rr
- final step of exm-logistic-or-beetles annotated (evaluate the exponential)
- exm-conditional-or-swap now introduces the WCGS data itself
(design, cohort, Type A/B definition, @rosenman1975coronary) instead of
relying on the later WCGS section
- exm-or-inv-MI: count substitutions no longer marked \eqdef; now cite
@thm-est-odds (estimated odds = events/non-events) and use the
\eror/\eodds estimator macros
- new plaintext 'Dobson's guideline' sentence -> @dobson4e citekey
- def-exposure-OR now paired with {#exm-exposure-OR-oc-mi}
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…urated-model log-likelihood; collapsibility restatement uses eqdef Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
…apter Move the _sec_intro_bernoulli_models include tree (31 subfiles) out of the logistic regression chapter into a new standalone chapter, chapters/binary-outcome-associations.qmd, wired into all three render profiles (website render list + navbar, book TOC, handout list). Convert all 63 cross-chapter references in the 13 staying files from @id crossref syntax to explicit relative links (binary-outcome-associations.qmd#id), since @id does not resolve across rendered pages in a Quarto website project. Retarget the basic-statistical-methods link to the new chapter, and add pointer notes in both chapters' introductions. Both chapters render with zero unresolved crossrefs; all 63 new link anchors verified against the rendered HTML. Part of #1023 (workstream 9 of 9); closes #1032. Co-Authored-By: Claude <noreply@anthropic.com>
# Conflicts: # _subfiles/logistic-regression/_sec_expit.qmd # _subfiles/logistic-regression/_sec_logistic-fitting.qmd
…e entries Per review suggestion on #1040: latex-macros defines \eSigma via the \est indirection that CLAUDE.md prefers for new content; swap the four literal \hat{\Sigma} occurrences in the log-odds and Delta-log-odds variance displays. Co-Authored-By: Claude <noreply@anthropic.com>
|
Claude finished review — View run Review posted: #1042 (comment) Summary: I reviewed PR #1042 (splitting the univariate binomial/odds-ratio content out of the logistic-regression chapter into a new
No blocking issues found. One optional, non-blocking style note about a VerdictReady for merge |
|
Acknowledging the one optional note from the review (the Generated by Claude Code |
Matches the locator already used for the same minimum-expected-frequency guideline at the callout earlier in the file (added in the citations PR). Addresses the non-blocking review finding on #1038. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
|
Claude finished review — View run Code reviewI compared the current PR diff ( The prior review already performed a full mechanical verification (profile-YAML wiring, a complete include-tree walk for stale same-chapter refs to moved anchors, spot-checks of ~10 converted link texts against their target headings, and citation-key resolution), and found no blocking issues. That verdict — comment #4997141271, posted 2026-07-16T22:20:46Z, Ready for merge — still stands, since nothing in the reviewable diff has changed. The author's follow-up (comment #4997389650) also already addressed the one optional, non-blocking Current CI status: No Summary: No new issues found. Checked for bugs and CLAUDE.md compliance — diff is identical to the previously reviewed version, and that review's findings still apply. VerdictReady for merge |
The summary subfile is included by both chapters/logistic-regression.qmd and chapters/exam-formula-sheet.qmd; bare @id crossrefs only resolve in the former and rendered as broken ?@id text in the exam formula sheet. Convert all 103 bare refs to explicit [type](logistic-regression.qmd#id) links (the same pattern the stacked chapter-split PR already uses), and restore \eqdef on the @def-g-computation defining equality per the CLAUDE.md math-notation rule. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
Resolves the summary-subfile conflict from lr-8's dual-render crossref fix (5aa6f03): refs to anchors that moved to the new binary-outcome- associations chapter keep this branch's targets; refs to anchors staying in the logistic-regression chapter take lr-8's new explicit-link form. All three parent chapters (logistic-regression, binary-outcome- associations, exam-formula-sheet) re-rendered with zero broken refs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
|
Claude finished review — View run Code reviewI checked whether anything has changed since the last two review rounds on PR #1042: the diff is identical — same 18 files, same The original review (comment #4997141271, posted 2026-07-16T22:20:46Z) performed the full mechanical verification: parsed all three Quarto profile YAMLs and confirmed correct wiring per CLAUDE.md, walked the entire include tree (32 moved files / 130 anchors vs. 68 staying files) to confirm zero stale same-chapter refs to moved anchors, spot-checked ~10 converted link texts against their target headings, and verified all citation keys resolve in A second confirming review (comment #4997715690's parent) already re-verified the diff was unchanged as of 2026-07-17T00:18:58Z and restated the same verdict. Nothing has changed since then either. CI status: No Summary: No new findings — diff is identical to the previously reviewed version, and that review's verification and verdict still apply. VerdictReady for merge |
|
The red Fix: gha#263 (closes gha#262) raises the cap to 12 GB in the Generated by Claude Code |
Code reviewConfirming review — no new findings. I compared the current PR head ( The prior verdict — comment #4997141271, Ready for merge — still stands: all three render profiles correctly wire in the new chapter, the No new issues found. VerdictReady for merge |
|
Claude finished review — View run Posted a confirming review on d-morrison/rme#1042. Summary: The current PR head ( VerdictReady for merge |
Cascades #1040's squash into this branch; the single conflicted file resolves to this branch's side, which already contains it. Merged tree verified byte-identical to the pre-merge branch tree (empty staged diff vs first parent). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
|
Claude finished review — View run The PR is already merged. No further review is needed or possible on a merged PR. VerdictReady for merge This PR (#1042) is already merged (merged 2026-07-17). The last commit was a content-neutral merge of |
Built to branch |
Closes #1032. Part of #1023 (workstream 9 of 9 — the final one). Stacked on #1040 — merge order: #1035 → #1036 → #1037 → #1038 → #1039 → #1040 → this.
The logistic-regression chapter opened with ~1,900 rendered lines of univariate/binomial material (probability, odds, odds ratios, risk ratios, case-control designs) before reaching logistic regression itself. This PR moves that content into its own chapter, per the review discussion on #1023:
chapters/binary-outcome-associations.qmd("Measures of Association for Binary Outcomes"): takes over the_sec_intro_bernoulli_models.qmdinclude tree (31 subfiles), with its own intro noting these concepts are the vocabulary for regression models of binary outcomes and a forward pointer to the logistic-regression chapter._quarto-website.yml(render list + navbar, placed before logistic-regression),_quarto-book.yml(TOC),_quarto-handout.yml.@idcrossref syntax to explicit relative links (binary-outcome-associations.qmd#id), since@iddoes not resolve across rendered pages in a Quarto website project. Link text taken from each target's actual heading; the summary's "Name (@id)" entries use a consistent short bracketed style.chapters/basic-statistical-methods.qmd's OR/RR link now points at the new chapter.Verification: both chapters render clean (
?@count 0 in each); every one of the 63 new link anchors confirmed to resolve to an existingid=in the rendered target HTML; spellcheck clean; lint — only 4 pre-existing findings in_sec-logistic-RR-RD.qmdcode chunks this PR does not touch (line length,pi_hat_*naming), left per the "fix only what you changed" rule.Note: #938 (chapter-length concerns) may be partially addressed by this split — worth re-checking its status after this merges.
🤖 Generated with Claude Code
https://claude.ai/code/session_013p49KvCbycnFLoSxh66dce
Generated by Claude Code