I have to calculate many correlations with mostly ordinal variables and I use Kendall's tau for this. In some cases there is one binary and one ordinal variable and in some cases there are two binary variables. Can I use Kendall's tau for the lase case, too? I know I could use other methods for this but I think it would be more consistent if I use Kendalls's tau all the time. Does this make sense?
Data <- data.frame(A = sample(1:2, 30, replace = TRUE))
Data$B <- as.numeric((Data$A*0.9 + rnorm(30)) > 2)
table(Data$A, Data$B)
> cor.test(Data$A, Data$B, method = "kendall", alternative = "greater")
Kendall's rank correlation tau
data: Data$A and Data$B
z = 1.6267, p-value = 0.0519
alternative hypothesis: true tau is greater than 0
sample estimates:
tau
0.3020793