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

Added post-hoc table for residuals #419

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

MAgojam
Copy link
Contributor

@MAgojam MAgojam commented Dec 3, 2024

Summary of Changes

This PR introduces a dedicated post-hoc residuals table (phoc) to complement the contingency table analyses.
Alongside the primary frequency tables and their associated statistics, the phoc table provides a richer diagnostic layer by presenting an array of residuals at the cell level.

Key Features:

  • New phoc table: Adds a post-hoc overview of cell-level residuals (Unstandardized, Pearson, Standardized, and Adjusted).
  • Residual Types:
    • Unstandardized: Raw differences between observed and expected counts.
    • Pearson: Residuals scaled by the square root of the expected values.
    • Standardized: Residuals further normalized to account for row and column distributions, facilitating clearer interpretation.
    • Adjusted: Residuals derived from a Poisson GLM, providing an additional layer of refinement by incorporating row and column effects.
  • Integration: Computations are seamlessly integrated into the existing workflow. A chi-square test and a GLM fit are performed internally, and their results are then rendered in the phoc table.
  • Enhanced Testing: The testconttables.R file has been updated with new tests, ensuring the accuracy and consistency of each residual type.

User Benefit:

This enhancement offers a deeper analytical perspective, enabling users to pinpoint meaningful discrepancies and interpret their contingency table results with greater clarity and nuance.

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.

Hi @MAgojam,
Awesome work, i think this will make a great addition to the contingency table analysis! Overall, I think this PR is already in a pretty good state, but I've added some comments on where I think improvements can be made. Thanks for your work!
Cheers,
Ravi

jamovi/conttables.u.yaml Show resolved Hide resolved
jamovi/conttables.u.yaml Outdated Show resolved Hide resolved
jamovi/conttables.r.yaml Outdated Show resolved Hide resolved
jamovi/conttables.r.yaml Outdated Show resolved Hide resolved
jamovi/conttables.r.yaml Outdated Show resolved Hide resolved
R/conttables.b.R Outdated Show resolved Hide resolved
R/conttables.b.R Outdated Show resolved Hide resolved
R/conttables.b.R Outdated Show resolved Hide resolved
R/conttables.b.R Outdated Show resolved Hide resolved
tests/testthat/testconttables.R Outdated Show resolved Hide resolved
MAgojam and others added 2 commits December 13, 2024 13:54
@MAgojam
Copy link
Contributor Author

MAgojam commented Dec 13, 2024

Hi @raviselker,

Thank you for your feedback on my PR. I've carefully reviewed your comments and have made the necessary adjustments. I've also conducted additional testing to ensure that the changes work as intended.

Please let me know if you would like me to provide any further details.

Regards,
Maurizio

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