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 |
…ORDLIST duplicates Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/53ac613d-5e7f-468f-87c4-ed701a5c4220 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commit
|
Built to branch |
|
@copilot resolve the merge conflicts in this pull request |
d-morrison
left a comment
There was a problem hiding this comment.
- always facet HERS graphs by HT (using
label_both(https://ggplot2.tidyverse.org/reference/labellers.html)). - include examples with the HERS data for all the Evaluating model fit subsections
- move the introduction of the HERS dataset from https://d-morrison.github.io/rme/pr-preview/pr-381/Linear-models-overview.html#motivating-example-hers-data to directly after the introduction of the birthweight data set
- move all the new HERS data content into subfiles, so we can reposition them easily as needed
…odel-hers-dataset # Conflicts: # inst/WORDLIST Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Done in commit |
- Extract HERS data intro into new _sec_hers_data.qmd - Update _sec_hers_lm_parallel.qmd: remove intro, add HT faceting to fitted values plot - Update _sec_hers_lm_interact.qmd: add HT faceting to interaction model plot - Insert HERS data include in _sec_linreg_understanding.qmd after birthweight data notation - Create _sec_hers_lm_gof.qmd with AIC/BIC/deviance/LRT examples - Create _sec_hers_lm_diagnostics.qmd with residuals and QQ plots faceted by HT - Create _sec_hers_lm_model_selection.qmd with LRT model comparison - Update _sec_linreg_assess.qmd to include new HERS assess subfiles All HERS scatter plots now use facet_wrap(~HT, labeller = label_both). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
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:
|
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, 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 groupinst/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())