Skip to contents

Calculates kendall-tau, with consideration of missingness providing information. Uses the calculation of tau-b.

Usage

ici_kt(
  x,
  y,
  perspective = "local",
  alternative = "two.sided",
  continuity = FALSE,
  output = "simple"
)

Arguments

x

numeric vector

y

numeric vector

perspective

should we consider the "local" or "global" perspective?

alternative

what is the alternative for the p-value test?

continuity

logical: if true, a continuity correction is applied to the p-value

output

used to control reporting of values for debugging

Value

kendall tau correlation, p-value, max-correlation, completeness

Details

Calculates the information-content-informed Kendall-tau correlation measure. This correlation is based on concordant and discordant ranked pairs, like Kendall-tau, but also includes missing values (as NA). Missing values are assumed to be primarily due to lack of detection due to instrumental sensitivity, and therefore encode some information.

For more details see the ICI-Kendall-tau vignette:

browseVignettes("ICIKendallTau")

Examples

x = sort(rnorm(100))
y = x + 1
y2 = y
y2[1:10] = NA
ici_kt(x, y)
#>          tau       pvalue      tau_max completeness 
#> 1.000000e+00 3.480281e-49 1.000000e+00 1.000000e+00 
ici_kt(x, y2, "global")
#>          tau       pvalue      tau_max completeness 
#> 9.954442e-01 2.228308e-48 9.954442e-01 9.000000e-01 
ici_kt(x, y2)
#>          tau       pvalue      tau_max completeness 
#> 9.954442e-01 2.228308e-48 9.954442e-01 9.000000e-01