Conversation
…ter 4 Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/780d27e6-3176-4828-9ead-2f708a8dc707 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/780d27e6-3176-4828-9ead-2f708a8dc707 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
add a model with interactions, like we did for the birthweight data. intersperse the HERS analysis with the corresponding sections of the birthweight analysis |
|
@copilot add a model with interactions, like we did for the birthweight data. intersperse the HERS analysis with the corresponding sections of the birthweight analysis |
…tion model Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/5c9bd00e-5395-40df-8e43-9ea2e760fca2 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
…erator Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/5c9bd00e-5395-40df-8e43-9ea2e760fca2 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commit
Each HERS section follows the same structure as its birthweight counterpart: model equation, parameter table, and fitted-values plot. 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot add interaction between bmi and statin use to the HERS model, and remove the interaction between bmi and HT |
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/f3c2ef8c-874d-4c6f-8c92-427a61e70055 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commit
The model equation is now: 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot resolve merge conflicts |
LRT is already covered in _sec_hers_lm_model_selection.qmd. The GOF file should focus on AIC, BIC, and deviance only. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commits
|
There was a problem hiding this comment.
Pull request overview
This PR integrates a HERS dataset linear regression example into the “Linear Models Overview” chapter, interleaving it with the existing birthweight analysis to follow the narrative flow of Vittinghoff Ch. 4.
Changes:
- Adds new HERS-focused Quarto subfiles covering data intro, parallel-lines and interaction models, GOF, diagnostics, and model selection.
- Inserts the new HERS subfiles into the “Understanding…” and “Assessing model fit” sections via
{{< include ... >}}. - Updates
inst/WORDLISTto reflect new terminology and deduplicate/sort entries.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| inst/WORDLIST | Updates spelling whitelist for new HERS terms and general cleanup. |
| _subfiles/Linear-models-overview/_sec_linreg_understanding.qmd | Includes new HERS data + modeling sections into the narrative flow. |
| _subfiles/Linear-models-overview/_sec_linreg_assess.qmd | Includes new HERS GOF/diagnostics/model-selection examples after birthweight sections. |
| _sec_hers_data.qmd | New HERS dataset intro: load data, show table/plot, define notation. |
| _sec_hers_lm_parallel.qmd | New HERS parallel-lines model fit + coefficient table + fitted-values overlay plot. |
| _sec_hers_lm_interact.qmd | New HERS interaction model fit + interpretation + fitted overlay plot. |
| _sec_hers_lm_gof.qmd | New AIC/BIC and deviance comparisons for the HERS models. |
| _sec_hers_lm_diagnostics.qmd | New residual-vs-fitted and QQ diagnostics plots (currently for hers_lm1). |
| _sec_hers_lm_model_selection.qmd | New LRT comparison (lrtest) between hers_lm1 and hers_lm2. |
|
|
||
| ::: notes | ||
|
|
||
| {{< include _sec_hers_intro.qmd >}} |
| ::: notes | ||
| "Placebo" is the **reference level** for the categorical variable $T$, | ||
| and "no" is the **reference level** for statin use $U$. | ||
| The choice of reference level is arbitrary; | ||
| it only affects the interpretation of the intercept and corresponding indicator coefficients. |
| @@ -0,0 +1,34 @@ | |||
| ### Diagnostics for `hers` models | |||
|
@copilot apply changes based on the comments in this thread also, add a graph of the key variables of the HERS data, including the treatment variable, the outcome variable, and the most important covariates |
…ariables plot Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/a89643f9-3164-469b-9b64-621cc53426a0 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/a89643f9-3164-469b-9b64-621cc53426a0 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commits PR review fixes:
Key variables graph:
|
There was a problem hiding this comment.
Pull request overview
Adds a new HERS linear regression walkthrough (parallel lines, interaction, GOF/diagnostics/model selection) into the Linear Models Overview chapter, interleaved with the existing birthweight narrative to mirror Vittinghoff Ch. 4.
Changes:
- Inserts new HERS include subfiles into the “Understanding linear regression” and “Assessing model fit” subfiles.
- Adds new Quarto subfiles at repo root for HERS data intro, two models, GOF, diagnostics, and LRT-based model selection.
- Updates
inst/WORDLISTwith additional allowed technical terms.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
inst/WORDLIST |
Updates spellcheck allowlist for new terminology used in the added HERS content. |
_subfiles/Linear-models-overview/_sec_linreg_understanding.qmd |
Includes the HERS intro + model examples into the “Understanding” flow. |
_subfiles/Linear-models-overview/_sec_linreg_assess.qmd |
Includes HERS GOF/diagnostics/model-selection examples into the “Assessing fit” flow. |
_sec_hers_data.qmd |
New HERS dataset introduction, plots, and notation. |
_sec_hers_lm_parallel.qmd |
New HERS parallel-lines model example and fitted-values visualization. |
_sec_hers_lm_interact.qmd |
New HERS interaction model example and visualization by statin use. |
_sec_hers_lm_gof.qmd |
New AIC/BIC and deviance comparisons for the two HERS models. |
_sec_hers_lm_diagnostics.qmd |
New residual-vs-fitted and QQ diagnostics for both HERS models. |
_sec_hers_lm_model_selection.qmd |
New LRT comparison between HERS models. |
| hers_lm2 |> | ||
| parameters() |> | ||
| parameters::print_md( | ||
| include_reference = include_reference_lines, | ||
| select = "{estimate}" | ||
| ) |
| WCGS | ||
| Welch | ||
| Zhou | ||
| biomarkers | ||
| Biostat | ||
| bmatrix | ||
| BMI | ||
| bmt |
| ### Motivating example: `hers` data {.smaller} | ||
|
|
||
| :::{.callout-note} | ||
| This section is based on @vittinghoff2e, Chapter 4. |
|
@copilot add GGally package to renv and Description |
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/911ad1ab-e623-4550-9811-addaf2dbd9b9 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commit |
Integrates a HERS dataset linear regression example into the "Linear Models Overview" chapter, interspersed with the existing birthweight analysis to mirror the narrative flow of Vittinghoff Ch. 4.
Changes Made
HERS content subfiles (all at repo root, for easy repositioning)
_sec_hers_data.qmd— HERS data introduction: data loading, scatter plot (faceted by HT withlabel_both), pairwise key-variables plot (GGally::ggpairs()), and data notation (H, B, V variables)_sec_hers_lm_parallel.qmd— Parallel lines model:LDL ~ HT + BMI; fitted-values plot faceted by HT_sec_hers_lm_interact.qmd— Interaction model:LDL ~ HT + BMI + statins + BMI:statins; plot faceted by HT_sec_hers_lm_gof.qmd— Goodness of fit: AIC/BIC table and deviance for both HERS models_sec_hers_lm_diagnostics.qmd— Diagnostics: residuals vs fitted and QQ plots for bothhers_lm1andhers_lm2, all faceted by HT withlabel_both_sec_hers_lm_model_selection.qmd— Model selection: LRT comparing the two HERS modelsStructure in
_sec_linreg_understanding.qmd_sec_hers_data.qmd) inserted directly after the birthweight dataset section"Assessing model fit" section (
_sec_linreg_assess.qmd)Other
BMI:statins(notBMI:HT); statin usefacet_wrap(~HT, labeller = label_both)relevel(ref = "placebo")forHT,relevel(ref = "no")forstatinsGGally::ggpairs()key-variables panel added to the HERS data tabset, showing LDL, HT, BMI, statins, and age colored by treatment groupGGally(v2.4.0) added toDESCRIPTIONSuggests andrenv.lockinst/WORDLISTdeduplicated and sorted (105 unique words after merging with main)_sec_exm_hers_lm.qmdTesting
lintr::lint()on all changed.qmdfiles)spelling::spell_check_package())