Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correlate(): Add sample size output and comparison variable option #47

Closed
LKobilke opened this issue Oct 13, 2023 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@LKobilke
Copy link
Collaborator

Two requests for correlate():

  1. Include sample size ('n') in the output. Or give an option to include it (like in SPSS).
  2. Allow specifying a comparison variable (= SPSS's "correlate with") to reduce output size. Currently, the output can be overwhelming.
@LKobilke LKobilke added the enhancement New feature or request label Oct 13, 2023
@LKobilke
Copy link
Collaborator Author

1. First request, include n:
By default, correlate() will now include sample size:
image

And to_correlate_matrix() provides the sample size as a header if only two variables are specified:
image

2. Second request, correlate with focus variable:
I've implemented a "with" parameter in the correlate() function that takes a focus variable that everything else is correlated against:

image

Also works without specifying vars:

image

Specifiyng both the partial and the with paramter in a correlate() will raise an error:

image

@MarHai
Copy link
Collaborator

MarHai commented Nov 12, 2023

Great addition!

My only criticism here is, again, on the string format of the with parameter -- the remainder of the package always works with dplyr vocabulary. We should stick to that, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants