Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor: Standardize residual titles and column for improved clarity #429

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MAgojam
Copy link
Contributor

@MAgojam MAgojam commented Mar 30, 2025

Refactor: Standardize residual titles and column for improved clarity

This PR addresses the terminology inconsistencies in residual labels within the chi-square analysis post-hoc tests, as raised in the following query:
https://forum.jamovi.org/viewtopic.php?p=12760#p12760

Specifically, this PR:

  • Renames the "Residuals" column to "Type".
  • Updates the residual titles to align with standard statistical terminology and R chisq.test() results:
    • "Pearson residuals" remain as "Pearson Residuals", consistent with the chisq.test() output of "residuals".
    • "Standardized residuals" are renamed to "Standardized Residuals (Adjusted Pearson)", aligning with the chisq.test() output of "stdres".
    • "Adjusted residuals" are renamed to "Deviance Residuals (Poisson GLM)" and a note is added to the table describing their calculation.
  • Adds a note to the table explaining that "Deviance Residuals" are adjusted residuals from a Poisson GLM.

These changes aim to:

  • Resolve the confusion caused by the current terminology.
  • Improve the educational value of Jamovi by aligning its output with standard statistical literature and R chisq.test() results.
  • Provide clear and accurate residual information for users.

Please review the updated labels and the added note for accuracy and clarity. Your feedback is appreciated.

Copy link
Member

@raviselker raviselker left a comment

Choose a reason for hiding this comment

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

Just a bunch of small comments (should be easy to fix)

Comment on lines +650 to +651
phTitle <- jmvcore::format('Post Hoc Test (Type: {title})', title=singleResTitle)
postHoc$setTitle(.(phTitle))
Copy link
Member

Choose a reason for hiding this comment

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

The translation should be done on the original pre-formatted string (as the translation is done without running the code). Also, I don't think the Type is necessary here. So it would be something like this:

Suggested change
phTitle <- jmvcore::format('Post Hoc Test (Type: {title})', title=singleResTitle)
postHoc$setTitle(.(phTitle))
phTitle <- jmvcore::format(.('Post Hoc Test ({title})'), title=singleResTitle)
postHoc$setTitle(phTitle)


- name: hlresP
title: Highlight values above
title: Highlight Pearson Residuals Above
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this value as it was, as this option is put under the appropriate residual in the UI. Now, there's some unnecessary repetition in the UI.


- name: hlresS
title: Highlight values above
title: Highlight Standardized Residuals Above
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this value as it was, as this option is put under the appropriate residual in the UI. Now, there's some unnecessary repetition in the UI.


- name: hlresA
title: Highlight values above
title: Highlight Deviance Residuals Above
Copy link
Member

Choose a reason for hiding this comment

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

I'd leave this value as it was, as this option is put under the appropriate residual in the UI. Now, there's some unnecessary repetition in the UI.

@@ -407,61 +407,58 @@ options:
stack or side by side (default), barplot type

- name: resU
title: Unstandardized residuals
title: Unstandardized Residuals
Copy link
Member

Choose a reason for hiding this comment

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

We only do headers in title case, the rest should be in sentence case (so the way it was before)

a number (default: 2.0), highlight values in the `'postHoc'` table
above this value
R: >
A numeric value (default: 2.0), highlight Pearson residuals above this threshold in the Post Hoc Tests table.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A numeric value (default: 2.0), highlight Pearson residuals above this threshold in the Post Hoc Tests table.
A numeric value (default: 2.0), highlight Pearson residuals above this threshold in the post hoc tests table.

R: >
`TRUE` or `FALSE` (default), provide Standardized residuals
R: >
`TRUE` or `FALSE` (default), display standardized residuals (adjusted Pearson) in the Post Hoc Tests table.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`TRUE` or `FALSE` (default), display standardized residuals (adjusted Pearson) in the Post Hoc Tests table.
`TRUE` or `FALSE` (default), display standardized residuals (adjusted Pearson) in the post hoc tests table.

a number (default: 2.0), highlight values in the `'postHoc'` table
above this value
R: >
A numeric value (default: 2.0), highlight standardized residuals above this threshold in the Post Hoc Tests table.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A numeric value (default: 2.0), highlight standardized residuals above this threshold in the Post Hoc Tests table.
A numeric value (default: 2.0), highlight standardized residuals above this threshold in the post hoc tests table.

R: >
`TRUE` or `FALSE` (default), provide Adjusted residuals
R: >
`TRUE` or `FALSE` (default), display deviance residuals from a Poisson GLM in the Post Hoc Tests table.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`TRUE` or `FALSE` (default), display deviance residuals from a Poisson GLM in the Post Hoc Tests table.
`TRUE` or `FALSE` (default), display deviance residuals from a Poisson GLM in the post hoc tests table.

a number (default: 2.0), highlight values in the `'postHoc'` table
above this value
R: >
A numeric value (default: 2.0), highlight deviance residuals above this threshold in the Post Hoc Tests table.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
A numeric value (default: 2.0), highlight deviance residuals above this threshold in the Post Hoc Tests table.
A numeric value (default: 2.0), highlight deviance residuals above this threshold in the post hoc tests table.

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.

2 participants