Skip to content

Add formal linear-regression diagnostic test summaries (Fligner–Killeen, Levene/Brown–Forsythe, Shapiro–Wilk)#538

Open
Copilot wants to merge 16 commits intomainfrom
copilot/add-summaries-of-diagnostic-tests
Open

Add formal linear-regression diagnostic test summaries (Fligner–Killeen, Levene/Brown–Forsythe, Shapiro–Wilk)#538
Copilot wants to merge 16 commits intomainfrom
copilot/add-summaries-of-diagnostic-tests

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

  • Review new PR comment requesting figure cross-references
  • Check recent CI workflow run status via GitHub MCP
  • Update diagnostics comparison bullets to cross-reference the corresponding figures
  • Run minimal required validation for changed .qmd file (quarto render, lintr, spelling)
  • Commit and push changes
  • Reply to PR comment with commit hash and screenshot

Copilot AI requested review from Copilot and removed request for Copilot April 16, 2026 07:58
Copilot AI linked an issue Apr 16, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot April 16, 2026 09:13
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>
Copilot AI requested review from Copilot and removed request for Copilot April 16, 2026 09:29
Copilot AI changed the title [WIP] Add summaries of diagnostic tests for linear regression Add formal linear-regression diagnostic test summaries (Fligner–Killeen, Levene/Brown–Forsythe, Shapiro–Wilk) Apr 16, 2026
Copilot AI requested a review from d-morrison April 16, 2026 09:31
Copilot AI review requested due to automatic review settings April 16, 2026 16:53
@d-morrison d-morrison marked this pull request as ready for review April 16, 2026 16:53

Interpretation rule:
for all three tests,
a small p-value is evidence against the corresponding model assumption.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

compare with visual diagnostics

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

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 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.

Comment thread _subfiles/Linear-models-overview/_sec_linreg_diagnostics.qmd Outdated
Comment thread _subfiles/Linear-models-overview/_sec_linreg_diagnostics.qmd Outdated
Comment thread _subfiles/Linear-models-overview/_sec_linreg_diagnostics.qmd Outdated
Copilot AI and others added 2 commits April 16, 2026 17:04
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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

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:

  • r-forge.r-project.org
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R stat�� --porcelain --ignore-submodules renv-watchdog-2547517a053b.R (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R renv�� -noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz spelling::spell_check_package() /home/REDACTED/.dotnet/tools/sh (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R (dns block)
  • www.john-fox.ca
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R stat�� --porcelain --ignore-submodules renv-watchdog-2547517a053b.R (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R renv�� -noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz spelling::spell_check_package() /home/REDACTED/.dotnet/tools/sh (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R (dns block)

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

Copilot AI requested a review from d-morrison April 16, 2026 17:09
@d-morrison
Copy link
Copy Markdown
Owner

@copilot add Brown-Forsythe Test; see https://demorrison.ucdavis.edu/files/Kutner5e.pdf for details

Copilot AI and others added 6 commits April 16, 2026 18:26
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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

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:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • android.clients.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • ehar.se
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R renv�� --noprofile /null 2&gt;/dev/null tnet/tools/sh _handler=\(.*\)$sh ms/texlive/tlnet/tmp/RtmpjzBCwl/renv-script-319b4da98a5b.sh (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R renv�� --load-path=/opt/quarto/share/formats/revealjs/r--location RouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyS/tmp/RtmpfXlG9D/renv-script-3a27318023b4.sh /sh (dns block)
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R renv�� /bin/sh sh /R/bin/exec/R -- rm -Rf &#39;/tmp/Rtm-e ache/pandoc/3.1.s/ /~&#43;~/g /R/bin/exec/R 3c45�� (dns block)
  • mirror.math.princeton.edu
    • Triggering command: /usr/bin/perl perl /home/REDACTED/.TinyTeX/bin/x86_64-linux/tlmgr update --self -j ACCEPT --config &#39;/tmp/Rtmp99ZMCk/renv-download-config-270e351d9acc&#39; 2&gt;&amp;1 cal/bin/gzip (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/tuWSSpxo6M/SvGrsGvaPv REDACTED tnet/tools/gzip TOKEN&#34;; }; f stodirname TOKEN&#34;; }; f sto/opt/google/chrome/google-chrome de/node/bin/git gzip (dns block)
    • Triggering command: /usr/bin/wget wget --no-check-certificate --user-agent=texlive/wget --tries=4 --timeout=30 -q -O /tmp/tuWSSpxo6M/SvGrsGvaPv REDACTED (dns block)
  • optimizationguide-pa.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --disable-dev-shm-usage --use-angle=swiftshader-webgl --mute-audio --crashpad-handler-pid=11556 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.Hs8ei1 --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,302332495725487505,6068995607560141843,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,1374735945075745935,83556478598897326,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --remote-debugging-port=4147 --remote-allow-origins=REDACTED --crash-dumps-dir=/tmp/RtmpRQPhhe/chrome-2ce26bd96e02-crashpad --no-sandbox --disable-dev-shm-usage --force-color-profile=srgb --disable-extensions --mute-audio _TOKEN&#34;; }; f sh /tmp�� ary/linux-ubuntu-noble/R-4.5/x86_64-pc-linux-gnu/repository/lifecycle/lifecycle_1.0.5.tar.gz (dns block)

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

Comment thread _subfiles/Linear-models-overview/_sec_linreg_diagnostics.qmd
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 16, 2026

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:

  • ehar.se
    • Triggering command: /opt/R/4.5.3/lib/R/bin/exec/R /opt/R/4.5.3/lib/R/bin/exec/R --no-echo --no-restore --file=/opt/quarto/share/rmd/rmd.R -c -- vides} rgo/bin/gzip 83d4e/aaca5b7519sh 83d4e/sass/635b7/tmp/RtmpUKNQ8i/renv-script-2d9e7996509c.sh (dns block)

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

Copilot AI requested a review from d-morrison April 16, 2026 19:18
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings April 20, 2026 07:30
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 1 out of 1 changed files in this pull request and generated 3 comments.


Compared with visual diagnostics:

- Fligner–Killeen / Levene summarizes the same heteroscedasticity signal
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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.

Suggested change
- Fligner–Killeen / Levene summarizes the same heteroscedasticity signal
- Fligner–Killeen / Levene summarizes the same heteroskedasticity signal

Copilot uses AI. Check for mistakes.
Comment on lines +924 to +928
- 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).
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

“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.

Copilot uses AI. Check for mistakes.
Comment on lines +1037 to +1040
mutate(
resid_lm2 = resid(bw_lm2),
std_resid_lm2 = rstandard(bw_lm2)
) |>
Copy link

Copilot AI Apr 20, 2026

Choose a reason for hiding this comment

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

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().

Suggested change
mutate(
resid_lm2 = resid(bw_lm2),
std_resid_lm2 = rstandard(bw_lm2)
) |>

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1
🚀 Preview available at: https://d-morrison.github.io/rme/pr-preview/pr-538/

Built to branch gh-pages at 2026-04-20 08:09 UTC.

@d-morrison d-morrison removed their request for review April 21, 2026 00:01
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.

add summaries of diagnostic tests for linear regression

3 participants