Skip to content

Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters#69

Open
Copilot wants to merge 8 commits intomainfrom
copilot/transcribe-lecture-notes
Open

Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters#69
Copilot wants to merge 8 commits intomainfrom
copilot/transcribe-lecture-notes

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 4, 2026

  • Create chapters/19-time-varying-treatments.qmd (pp. 255-265)
  • Create chapters/20-treatment-confounder-feedback.qmd (pp. 267-275)
  • Create chapters/21-g-methods-time-varying.qmd (pp. 277-302)
  • Create chapters/22-target-trial-emulation.qmd (pp. 305-320)
  • Create chapters/23-causal-mediation.qmd (pp. 323-330)
  • Update _quarto-website.yml navigation to include chapters 19-23
  • Apply \ind macro (replaces \perp\!\!\!\perp) across all chapters
  • Apply \E{...} macro (replaces E[...]) across all chapters
  • Add new technical terms to inst/WORDLIST; remove duplicate ggdag entry
  • Add qmd to inst/WORDLIST to fix spell check CI failure
  • Restore immunosuppression to inst/WORDLIST (was accidentally removed)
  • Fix nested E[\hat{\theta}]\E{\hat{\theta}} in chapters/11-why-model.qmd
  • Fix nested E[Y^a|L] / E[Y|A=a,L]\E{\E{...}} with \mid in chapters/02-randomized-experiments.qmd
  • Run spelling::spell_check_package() locally — no errors

Copilot AI requested review from Copilot and removed request for Copilot May 4, 2026 06:21
Copilot AI linked an issue May 4, 2026 that may be closed by this pull request
Copilot AI and others added 3 commits May 4, 2026 06:34
…ents

Chapter 19: Time-varying treatments
- Treatment history notation, counterfactuals under strategies
- Static vs. dynamic treatment strategies
- Sequentially randomized experiments
- Sequential exchangeability and positivity
- Time-varying confounding and feedback

Chapter 20: Treatment-confounder feedback
- Elements of feedback: L_k affected by A_{k-1} and confounds A_k
- Why standard regression (stratification, multivariable) fails
- Structural nature of the bias — not fixable by model flexibility
- Adjusting for past treatment produces controlled direct effects

Chapter 21: G-methods for time-varying treatments
- G-formula for time-varying treatments (big g-formula)
- IP weighting with stabilized weights SW^A and SW^C
- Doubly robust AIPW estimator
- G-estimation of structural nested mean models (SNMMs)
- Censoring as a time-varying treatment

Chapter 22: Target trial emulation
- ITT vs. per-protocol effects
- Specifying the target trial components
- Immortal time bias and new user/active comparator design
- Sequential trials design for time zero alignment
- Unified framework for observational causal inference

Chapter 23: Causal mediation
- Limitations of classical Baron-Kenny mediation analysis
- Natural direct and indirect effects (NDE, NIE)
- Controlled direct effect (CDE)
- Interventionist/stochastic mediation approach
- Time-varying mediators as a special case of g-methods

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 06:42
Agent-Logs-Url: https://github.com/ucdavis/win/sessions/a538ac1b-2966-4beb-8ded-682aaf0e2482

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 06:52
Copilot AI changed the title [WIP] Transcribe lecture notes to match textbook content Add chapters 19–23 (Part III) and standardize LaTeX macros across all chapters May 4, 2026
Copilot AI requested a review from d-morrison May 4, 2026 06:53
@d-morrison d-morrison marked this pull request as ready for review May 4, 2026 08:06
Copilot AI review requested due to automatic review settings May 4, 2026 08:06
@d-morrison
Copy link
Copy Markdown
Collaborator

@copilot fix spellcheck

Agent-Logs-Url: https://github.com/ucdavis/win/sessions/649063ba-d668-42f8-8808-dc446b1d6867

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 4, 2026

@copilot fix spellcheck

Added qmd to inst/WORDLIST in fb2e992. The spell checker was flagging the file extension from the {{< include latex-macros/macros.qmd >}} shortcode in index.qmd. Verified locally with spelling::spell_check_package() — no errors.

@d-morrison d-morrison removed their request for review May 4, 2026 08:10
Copilot AI requested a review from d-morrison May 4, 2026 08:10
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Part III content (Chapters 19–23) to the Quarto lecture notes and standardizes common LaTeX operator notation across the existing chapters using the shared latex-macros submodule.

Changes:

  • Added new Quarto chapters 19–23 (time-varying treatments through mediation), each rendering to HTML/RevealJS/PDF (and DOCX, consistent with existing chapters).
  • Standardized expectation and independence notation across chapters (e.g., E[...]\E{...}, \perp\!\!\!\perp\ind).
  • Updated _quarto-website.yml navigation and expanded inst/WORDLIST for new technical terms.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
inst/WORDLIST Added causal-inference terms for spellcheck; removed duplicate entry.
_quarto-website.yml Added sidebar navigation entries for new Chapters 19–23.
chapters/01-introduction.qmd Macro standardization updates in math notation.
chapters/02-randomized-experiments.qmd Macro standardization updates in math notation.
chapters/03-observational-studies.qmd Macro standardization updates in math notation.
chapters/04-effect-modification.qmd Macro standardization updates in math notation.
chapters/05-interaction.qmd Macro standardization updates in math notation.
chapters/06-graphical-representation.qmd Macro standardization updates in math notation.
chapters/07-confounding.qmd Macro standardization updates in math notation.
chapters/09-measurement-bias.qmd Macro standardization updates in math notation.
chapters/10-random-variability.qmd Macro standardization updates in math notation.
chapters/11-why-model.qmd Macro standardization updates in math notation.
chapters/12-ip-weighting-marginal-structural-models.qmd Macro standardization updates in math notation.
chapters/13-standardization-parametric-g-formula.qmd Macro standardization updates in math notation.
chapters/14-g-estimation-structural-nested-models.qmd Macro standardization updates in math notation.
chapters/15-outcome-regression-propensity-scores.qmd Macro standardization updates in math notation.
chapters/16-instrumental-variable-estimation.qmd Macro standardization updates in math notation.
chapters/18-variable-selection-causal-inference.qmd Macro standardization updates in math notation.
chapters/19-time-varying-treatments.qmd New Chapter 19 content (Part III).
chapters/20-treatment-confounder-feedback.qmd New Chapter 20 content (Part III).
chapters/21-g-methods-time-varying.qmd New Chapter 21 content (Part III).
chapters/22-target-trial-emulation.qmd New Chapter 22 content (Part III).
chapters/23-causal-mediation.qmd New Chapter 23 content (Part III).

Comment thread inst/WORDLIST
Comment thread chapters/11-why-model.qmd Outdated
Comment thread chapters/02-randomized-experiments.qmd Outdated
@d-morrison
Copy link
Copy Markdown
Collaborator

@copilot apply changes based on the comments in this thread

@d-morrison d-morrison removed their request for review May 4, 2026 08:12
…ize nested E[] macros in ch02 and ch11

Agent-Logs-Url: https://github.com/ucdavis/win/sessions/29247ca6-572c-4454-bb3b-38fc70b077c5

Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 4, 2026

@copilot apply changes based on the comments in this thread

Applied all three reviewer changes in 42c47e0:

  • Restored immunosuppression to inst/WORDLIST (was accidentally dropped)
  • chapters/11-why-model.qmd: inner E[\hat{\theta}]\E{\hat{\theta}}
  • chapters/02-randomized-experiments.qmd (lines 483-486): all inner raw E[Y^a|L]/E[Y^a|A=a, L]/E[Y|A=a, L] converted to nested \E{\E{... \mid ...}} with \mid

Copilot AI requested a review from d-morrison May 4, 2026 08:16
@d-morrison d-morrison requested review from Copilot and removed request for d-morrison May 4, 2026 08:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 23 out of 23 changed files in this pull request and generated 1 comment.

Comment thread inst/WORDLIST
Comment on lines 21 to 22
RStudio
RevealJS
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://ucdavis.github.io/win/pr-preview/pr-69/

Built to branch gh-pages at 2026-05-04 08:38 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

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.

transcribe the whole book

3 participants