qorf / quorum-language

The primary repository for the Quorum Programming Language
BSD 3-Clause "New" or "Revised" License
16 stars 7 forks source link

CorrelateGroups needs a way to generate a CSV Correlation Table #40

Closed andreas-stefik closed 1 year ago

andreas-stefik commented 1 year ago

The CorrelateGroups class can create pearson correlations across groups. This works fine, but if you want to examine a whole bunch of them, it outputs a giant list of them in the summary call, like so:

A Pearson's Correlation was performed. Columns: Participant and Group Statistic (t): 18.608 Degrees Of Freedom: 23.0 Probability: 0.0 Correlation: 0.968

A Pearson's Correlation was performed. Columns: Participant and DT Statistic (t): 3.326 Degrees Of Freedom: 23.0 Probability: 0.003 Correlation: 0.57

A Pearson's Correlation was performed. Columns: Participant and FS Statistic (t): 2.374 Degrees Of Freedom: 23.0 Probability: 0.026 Correlation: 0.444

A Pearson's Correlation was performed. Columns: Participant and DRT Statistic (t): -0.423 Degrees Of Freedom: 23.0 Probability: 0.676 Correlation: -0.088

A Pearson's Correlation was performed. Columns: Participant and CT Statistic (t): 2.935 Degrees Of Freedom: 23.0 Probability: 0.007 Correlation: 0.522

A Pearson's Correlation was performed. Columns: Group and DT Statistic (t): 3.675 Degrees Of Freedom: 23.0 Probability: 0.001 Correlation: 0.608

A Pearson's Correlation was performed. Columns: Group and FS Statistic (t): 2.686 Degrees Of Freedom: 23.0 Probability: 0.013 Correlation: 0.489

A Pearson's Correlation was performed. Columns: Group and DRT Statistic (t): -0.328 Degrees Of Freedom: 23.0 Probability: 0.746 Correlation: -0.068

A Pearson's Correlation was performed. Columns: Group and CT Statistic (t): 3.293 Degrees Of Freedom: 23.0 Probability: 0.003 Correlation: 0.566

A Pearson's Correlation was performed. Columns: DT and FS Statistic (t): 9.331 Degrees Of Freedom: 23.0 Probability: 0.0 Correlation: 0.889

A Pearson's Correlation was performed. Columns: DT and DRT Statistic (t): 0.013 Degrees Of Freedom: 23.0 Probability: 0.99 Correlation: 0.003

A Pearson's Correlation was performed. Columns: DT and CT Statistic (t): 10.583 Degrees Of Freedom: 23.0 Probability: 0.0 Correlation: 0.911

A Pearson's Correlation was performed. Columns: FS and DRT Statistic (t): -0.413 Degrees Of Freedom: 23.0 Probability: 0.683 Correlation: -0.086

A Pearson's Correlation was performed. Columns: FS and CT Statistic (t): 6.687 Degrees Of Freedom: 23.0 Probability: 0.0 Correlation: 0.813

A Pearson's Correlation was performed. Columns: DRT and CT Statistic (t): -1.255 Degrees Of Freedom: 23.0 Probability: 0.222 Correlation: -0.253

It works but is hard to read. I think we should have an action that can return a DataFrame that corresponds to a more traditional correlation table. This way you can output it to a CSV or whatever you want and interpret as you see fit.

AtlasShrugged1 commented 1 year ago

Complete. use GetCorrelations() for a DataFrame of all computed correlations.