Skip to content

Feat/215/all stats for rxc - #216

Merged
d-callan merged 5 commits into
mainfrom
feat/215/allStats-for-rxc
Mar 23, 2023
Merged

d-callan merged 5 commits into
mainfrom
feat/215/allStats-for-rxc

Conversation

@asizemore

@asizemore asizemore commented Mar 23, 2023 •

Copy link
Copy Markdown
Member

Resolves #215

The only behavior change is that using statistic = 'all' with an RxC table now will not err and will instead return chisq results. The results will be in the format of the 2x2 stats table.

I could have gone a little further in the S4 class stuff, but i tried to keep the scope reasonable. For example, I'm leaving the the fishers exact test for later. I also got caught in a small rabbit hole with the orderByReferenceValues(object) function. I wasn't sure how deep within the methods to split the TwoByTwo vs ContingencyTable (should they each have their own chisq fxn or should they have their own orderByReferenceValues or should orderByReferenceValues ignore ref vals if none given?).

Another thing i did was i let situations where we have fewer than 2 vals continue to get handled by the 2x2 flow. In mosaic.dt if no stat is set and we have fewer than 2 vals in the row and column, the stat gets set to 'all' which previously forced it through the 2x2 flow. Do we want to keep this behavior? Or should 2x2 be only 2x2 and the general contingency table handle the odd case of <2 x <2? I would guess the desired behavior is that the general contingency table handles that case?

@asizemore
asizemore marked this pull request as ready for review March 23, 2023 12:10
@asizemore
asizemore requested a review from d-callan March 23, 2023 12:10
Comment thread R/methods-ContingencyTable.R Outdated
object <- orderByReferenceValues(object)
setMethod("chiSqResults", signature("ContingencyTable"), function(object) {

# If we have reference values, reorder the data based on these values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Was this causing trouble? The reorder function should just be smart enough to handle this case

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

it was a bit. Originally it looked like one thing but then i realized it was another. Anyways long story short, fixed in the newest commit!

@asizemore
asizemore requested a review from d-callan March 23, 2023 14:26
@d-callan
d-callan merged commit 2d05b83 into main Mar 23, 2023
@d-callan
d-callan deleted the feat/215/allStats-for-rxc branch March 23, 2023 16: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.

Backend: mosaic plot.data class needs to support allStats for rxc tables

2 participants