Skip to content

refactoring the correlation package #298

Open
@mattansb

Description

@mattansb

As discussed in out meeting yesterday, the correlation package should be broken down (and built up!) into the following "bits":

A simple 1:1 correlation function (currently done in cor_test()

(#261, #260)

  • input: 2 vectors
  • methods: any of the 10~ currently available
    • Pearson correlations can also be Bayesian (via BayesFactor)
  • output: a tidy data frame - with CIs and p-values

The methods for tetrachoric, polychoric, and biserial correlations can be improved, I think.

Things left to do:

  • Finish docs for cor_test()
  • address all TODOs
  • Fix unit tests
  • Allow x and y to be vectors?

A correlation "matrix" function

(#292, #217, #232)

  • input: a data frame (or data frames) with or without those handy select arguments.
    • should also support grouped data frames
  • methods: same as for the 1:1 variant
  • output: a tidy (long) data frame
    • ... that can be transformed into a matrix-like output (currently via the summary() method).

A function for part/partial correlation

(#311, #301, #204?, #181)

This function will also produce multilevel correlations (#253, #207)?

  • input: a data frame with those handy select arguments to control
    • Need to be able to control what x/y are and what z are, and if z is partialled out from x, y, or both.
    • should also support grouped data frames?
  • methods: only Pearson for now?
  • output: a tidy (long) data frame
    • ... that can be transformed into a matrix-like output (currently via the summary() method).

Things to keep

  • The current plotting options in see are good.
  • All the cor_*() functions also, I think?
  • is.cor and isSquare (maybe rename to snake-case?)
  • z_fisher() (rename to fishers_z, which is more inline with "named" statistic convention in effectsize?)

Also welcoming @TomGeva that will be working on this with @bwiernik and myself

WIP can be found here: https://github.com/TomGeva/correlation2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions