Skip to content

Accurately transcribe Chapter 7: Confounding (pp. 77–92) - #62

Merged
d-morrison merged 6 commits into
mainfrom
copilot/accurately-transcribe-ch-7
May 4, 2026
Merged

d-morrison merged 6 commits into
mainfrom
copilot/accurately-transcribe-ch-7

Conversation

Copilot AI commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor
  • Rewrite chapters/07-confounding.qmd to accurately follow Chapter 7 of Hernán & Robins
    • Add ggdag/dagitty R setup chunk (matching Ch 6 style)
    • Fix intro paragraph
    • 7.1: concrete numerical example + ggdag Figure 7.1
    • 7.2: confounding ↔ lack of marginal exchangeability; standardisation calculation
    • 7.3: Fix Figure 7.2 Structure II — add U -> Y edge; update text to list both backdoor paths
    • 7.3: Fix Fine Point 7.1 — use ::: {.callout-note title="..."} without outer heading (repo convention)
    • 7.4: Fix Fine Point 7.2 — same callout markup fix
    • 7.5: Fix SWIG example — remove incorrect L -> a edge; L's arrow stays on natural-value A
    • Remove non-textbook Section 7.6; update Summary
    • Remove pre from inst/WORDLIST
    • Add *.log to .gitignore; remove accidentally committed LaTeX log files
    • Resolve merge conflict with origin/main: keep {{< include ../latex-macros/macros.qmd >}} from main before the setup chunk

Copilot AI requested review from Copilot and removed request for Copilot April 30, 2026 06:18
Copilot AI linked an issue Apr 30, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/ucdavis/win/sessions/df029107-dae5-4006-b73b-ee8b2afb2ae9

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot April 30, 2026 06:41
Copilot AI changed the title [WIP] Accurately transcribe chapter 7 with all details Accurately transcribe Chapter 7: Confounding (pp. 77–92) Apr 30, 2026
Copilot AI requested a review from d-morrison April 30, 2026 06:43
@d-morrison
d-morrison marked this pull request as ready for review May 4, 2026 01:57
Copilot AI review requested due to automatic review settings May 4, 2026 01:57

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.

Pull request overview

This PR rewrites Chapter 7 to better match the textbook’s treatment of confounding, replacing placeholder material with a fuller causal-diagram-based exposition and updated figures. It fits into the codebase as part of the ongoing transcription/modernization of the Quarto textbook chapters.

Changes:

  • Reworked chapters/07-confounding.qmd with a new numerical example, revised structural/backdoor-criterion discussion, new DAG-based figures, and an expanded SWIG section.
  • Removed the prior confounding-adjustment section and replaced it with textbook-aligned material on confounders, collider bias, and SWIGs.
  • Added new terms to inst/WORDLIST to support spell-checking for the updated chapter text.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
inst/WORDLIST Adds spell-check dictionary entries for new Chapter 7 terminology.
chapters/07-confounding.qmd Rewrites Chapter 7 content, figures, fine points, and SWIG discussion to align with the source text.

Comment thread chapters/07-confounding.qmd Outdated
Comment on lines +310 to +314
### Fine Point 7.1: Descendants of Treatment and Adjustment Bias

::: {.callout-note}
## Fine Point 7.1: Do Not Adjust for Descendants of Treatment

Comment thread chapters/07-confounding.qmd Outdated
Comment on lines +407 to +408
::: {.callout-note}
## Fine Point 7.2: Limitations of Association-Based Confounder Criteria
Comment thread chapters/07-confounding.qmd Outdated
}')
dag_b <- dagitty('dag {
U [pos="1,2"]; L [pos="1,1"]; A [pos="0,0"]; Y [pos="2,0"]
U -> L; L -> A; L -> Y; A -> Y
Comment thread chapters/07-confounding.qmd Outdated
Comment on lines +442 to +445
- $L \to a$ (the fixed intervention value is determined, but $L$ still affects what the natural value of $A$ would have been)
- $a \to Y^a$ (the intervention value $a$ causes $Y^a$)
- $L \to Y^a$ (the confounder $L$ also causes $Y^a$)
- $L \to A$ (the natural value of $A$ is caused by $L$)
Comment thread inst/WORDLIST Outdated
patchwork
perp
positivity
pre
@d-morrison

Copy link
Copy Markdown
Collaborator

@copilot apply changes based on the comments in this thread

Copilot AI and others added 2 commits May 4, 2026 02:52
…dges, remove 'pre' from WORDLIST

Agent-Logs-Url: https://github.com/ucdavis/win/sessions/efa9c6a7-bc2c-46e0-93d3-bc9c7c7cd2ca

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 02:52

Copilot AI commented May 4, 2026 •

Copy link
Copy Markdown
Contributor Author

@copilot apply changes based on the comments in this thread

Applied all five changes from the review (commit 395324b):

  1. Fine Point callout markup (7.1 and 7.2): Removed separate ### headings and inner ## headings; both callouts now use ::: {.callout-note title="..."} matching the repo convention in chapters/17-causal-survival-analysis.qmd.

  2. Structure II DAG missing U -> Y: Added the U -> Y edge so Structure II now shows a genuine backdoor path ($A \leftarrow L \leftarrow U \to Y$) that is blocked by conditioning on $L$. Updated the caption and the explanation text accordingly.

  3. SWIG L -> a edge: Corrected the SWIG example to remove L -> a. The edge list now correctly shows L -> A (incoming arrows stay on the natural-value half) and a -> Y^a (outgoing arrows leave from the fixed-value half), matching the construction rule just introduced.

  4. pre in WORDLIST: Removed pre from inst/WORDLIST.

Also added *.log to .gitignore to prevent LaTeX log files from being committed.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ftp.math.utah.edu
    • Triggering command: /usr/bin/perl perl /home/REDACTED/.TinyTeX/bin/x86_64-linux/tlmgr install luatexbase --output /tmp/r_OixpOkDd/bRuVjrhNys REDACTED (dns block)
    • Triggering command: /usr/bin/curl curl --user-agent texlive/curl --retry 4 --retry-delay 4 --connect-timeout 30 --fail --location --silent --output /tmp/ZxpnMS2FOO/k3RkihF4El REDACTED /wget c_vbO7Z0op /systems/texlive-P (dns block)
    • Triggering command: /usr/bin/wget wget --no-check-certificate --user-agent=texlive/wget --tries=4 --timeout=30 -q -O /tmp/ZxpnMS2FOO/k3RkihF4El REDACTED (dns block)
  • latex.us
    • Triggering command: /usr/bin/perl perl /home/REDACTED/.TinyTeX/bin/x86_64-linux/tlmgr update --self (dns block)
    • Triggering command: /usr/bin/curl curl --user-agent texlive/curl --retry 4 --retry-delay 4 --connect-timeout 30 --fail --location --silent --output /tmp/rwSm2G5aZ4/c_vbO7Z0op REDACTED (dns block)
    • Triggering command: /usr/bin/wget wget --no-check-certificate --user-agent=texlive/wget --tries=4 --timeout=30 -q -O /tmp/rwSm2G5aZ4/c_vbO7Z0op REDACTED (dns block)
  • mirror.ctan.org
    • Triggering command: /usr/bin/curl curl -Ls -o /dev/null -w %{url_effective} --connect-timeout 30 --max-time 30 REDACTED git renv�� (dns block)
    • Triggering command: /usr/bin/curl curl -Ls -o /dev/null -w %{url_effective} --connect-timeout 30 --max-time 30 REDACTED /R/bin/R conf�� (dns block)
    • Triggering command: /usr/bin/perl perl /home/REDACTED/.TinyTeX/bin/x86_64-linux/tlmgr install luatexbase --output /tmp/rF8HLX6wp0/Cfed87UATI REDACTED /home/REDACTED/.lo--connect-timeout (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@d-morrison

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts in this pull request

@d-morrison
d-morrison removed their request for review May 4, 2026 05:43
…anscribe-ch-7

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 05:47

Copilot AI commented May 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

Resolved in commit 4328eb5. The only conflict was in the chapter header — main added {{< include ../latex-macros/macros.qmd >}} to all chapters via PR #66. The resolution keeps the macros include first, followed by our setup R chunk and the full Chapter 7 rewrite.

Copilot AI requested a review from d-morrison May 4, 2026 05:48
@d-morrison
d-morrison merged commit ccc555e into main May 4, 2026
3 of 4 checks passed
@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-05-04 06:16 UTC

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.

accurately transcribe ch 7

3 participants