Conversation
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/7e0b4f05-0243-4783-b92c-ac0a48263e14 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/7e0b4f05-0243-4783-b92c-ac0a48263e14 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
|
||
| Interpretation rule: | ||
| for all three tests, | ||
| a small p-value is evidence against the corresponding model assumption. |
There was a problem hiding this comment.
compare with visual diagnostics
There was a problem hiding this comment.
Added a direct comparison between the formal tests and the corresponding visual diagnostics in _sec_linreg_diagnostics.qmd (residuals-vs-fitted, scale-location, QQ plot, and histogram), and pushed it in 92bfe0c.
Screenshot of the updated section: https://github.com/user-attachments/assets/1449eccc-af7c-42ae-ab1d-ac7401fc0071
There was a problem hiding this comment.
Pull request overview
Adds concise, formal summaries of common linear-regression diagnostic tests (variance homogeneity and residual normality) and demonstrates them on the existing birthweight interaction-model workflow.
Changes:
- Added a new “Formal diagnostic tests” subsection describing Fligner–Killeen, Levene/Brown–Forsythe, and Shapiro–Wilk tests (with null distributions and interpretation).
- Added a reproducible R example computing all three tests and presenting a compact results table.
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/3826fdc4-d9e9-45b5-a478-e6b62c33a630 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/3826fdc4-d9e9-45b5-a478-e6b62c33a630 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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 Brown-Forsythe Test; see https://demorrison.ucdavis.edu/files/Kutner5e.pdf for details |
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/43dcdf33-0784-475e-8d65-15e1ce35768c Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
|
Agent-Logs-Url: https://github.com/d-morrison/rme/sessions/212ae3bb-917c-4d4d-9707-a0091a9d08f7 Co-authored-by: d-morrison <2474437+d-morrison@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. 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:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
|
||
| Compared with visual diagnostics: | ||
|
|
||
| - Fligner–Killeen / Levene summarizes the same heteroscedasticity signal |
There was a problem hiding this comment.
In this section the term is used inconsistently: earlier you say “heteroskedasticity” (line 951) but later “heteroscedasticity” (line 1090). Please pick one spelling/term and use it consistently within the section.
| - Fligner–Killeen / Levene summarizes the same heteroscedasticity signal | |
| - Fligner–Killeen / Levene summarizes the same heteroskedasticity signal |
| - Brown--Forsythe testing | ||
| (a median-centered Levene variant, | ||
| where standard Levene centers on group means, | ||
| and Brown--Forsythe centers on group medians for more robustness; | ||
| e.g., via `car::leveneTest(..., center = median)` or equivalent code). |
There was a problem hiding this comment.
“Brown--Forsythe testing” reads like a gerund and is a bit unclear in a list of named procedures. Consider renaming this bullet to “Brown--Forsythe test” (or “Levene / Brown--Forsythe test”) for consistency with the other bullets.
| mutate( | ||
| resid_lm2 = resid(bw_lm2), | ||
| std_resid_lm2 = rstandard(bw_lm2) | ||
| ) |> |
There was a problem hiding this comment.
bw already has resid_lm2 and std_resid_lm2 added earlier in this file (see the earlier bw <- bw |> mutate(...) block). Recomputing them here is redundant and can become brittle if bw is ever filtered/reordered between model fitting and this chunk. Prefer selecting the existing columns (or deriving from model.frame(bw_lm2) to guarantee alignment) rather than overwriting them via mutate().
| mutate( | |
| resid_lm2 = resid(bw_lm2), | |
| std_resid_lm2 = rstandard(bw_lm2) | |
| ) |> |
Built to branch |
.qmdfile (quarto render,lintr,spelling)