VEuPathDB / plot.data

1 stars 0 forks source link

Feat/215/all stats for rxc #216

Closed asizemore closed 1 year ago

asizemore commented 1 year ago

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?