Skip to content

Fix con_ste and p - #92

Open
libo-zhang64 wants to merge 1 commit into
canlab:masterfrom
libo-zhang64:master
Open

libo-zhang64 wants to merge 1 commit into
canlab:masterfrom
libo-zhang64:master

Conversation

@libo-zhang64

Copy link
Copy Markdown
Contributor

The main focus is on fixing the computation and reporting of contrast standard errors (con_ste) and p-values (p) in cases involving autoregressive (AR) and robust regression, as well as ensuring undefined statistical tests are handled consistently. Additional improvements include more robust contrast validation, improved handling of rank-deficient models, and clearer reporting of results.

Key changes:

Contrast handling and validation:

  • Added explicit checks to prevent the use of contrasts in "brainony" mode and to ensure contrast matrices match the design matrix dimensions, with clear error messages for invalid input.
  • Improved estimability checks for contrasts when the design matrix X is rank-deficient, warning users when contrasts are not estimable.

Statistical computation corrections:

  • Fixed the calculation of contrast standard errors (con_ste) for AR and robust regression modes, ensuring they are computed and reported correctly. [1] [2] [3] [4] [5]
  • Updated the computation of degrees of freedom to use the rank of the design matrix, improving robustness for rank-deficient models. [1] [2]

Undefined test handling:

  • Introduced a sanitize_t_p helper to ensure undefined t- and p-values (e.g., from constant voxels or perfect fits) are set to t=0, p=1, so they cannot be mistakenly interpreted as significant. [1] [2]

Code cleanup and clarity:

  • Removed redundant or misplaced contrast validation logic, consolidating checks in a single location.

These changes collectively improve the reliability, interpretability, and user feedback of regression analyses in the toolbox.

This branch has not been deployed

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

1 participant