I understand that it's using "Pearson's product-moment correlation" and it's using biserial correlation when one variable is binary and the other is continuous. What is it doing when given two binary variables? Is the correlation coefficient given useful for exploratory analysis or should I instead look at something like Jaccard's?
Asked
Active
Viewed 54 times
1
-
2you mean `cor.test`? Read the documentation, with two binary variables rather make a contingency table. Where is `ggcor`? when mentioning functions not on the standard packages you should give the package also. There is a `GGally::ggcorr` function, do you mean that? Note that functions purely about software is off-topic here, try to reformulate to emphasize Q about methodology. Look at https://stats.stackexchange.com/questions/103801/is-it-meaningful-to-calculate-pearson-or-spearman-correlation-between-two-boolea/103806, which might be a duplicate – kjetil b halvorsen Jun 23 '21 at 23:40
-
@kjetilbhalvorsen Yes I do mean ggcorr (from ggplot2) and cor.test. I tried to read through the documentation but it wasn't clear to me what was happening when applying the function with two binary variables. I did look at that previous question but I was left more confused. I got quite a high correlation when using cor.test, but a much lower correlation when using Jaccard. – Nonya Jun 24 '21 at 00:48
-
You should tell us what is your goal, what question are you asking from the data (with non-statistical terminology). Otherwise we cannot help. But look at the contingency table (and show us). – kjetil b halvorsen Jun 24 '21 at 00:51
-
Correlation in $2\times 2$ contingency tables depends on one parameter, whence all measures of association are functions of one another. See https://en.wikipedia.org/wiki/Contingency_table#Measures_of_association. In this context, Pearson's correlation is the same as the ["phi coefficient"](https://en.wikipedia.org/wiki/Phi_coefficient). Your choice of a measure depends on what you are familiar with, how you wish to interpret it, and your audience. – whuber Jun 24 '21 at 13:43