This function computes the Kendall's correlation for each row
vector in x
.
See the Details section below for further information.
Usage
rowKendallCor(
x,
y,
alternative = c("two.sided", "greater", "less"),
conf.level = 0.95,
...
)
Arguments
- x
matrix
ordata.frame
.- y
numeric vector of data values. Must have the same length as
ncol(x)
.- alternative
character string indicating the alternative hypothesis for each row of
x
. It must be one of"two.sided"
(default),"greater"
or"less"
.- conf.level
numerical value or numeric vector of length
nrow(x)
. The confidence levels of the intervals. All values must be in the range of \([0:1]\) orNA
.- ...
further arguments to
cor.test
Value
A list containing two elements:
- statistic
A numeric vector, the values of the test statistic
- significance
A numeric vector, the p-values of the selected test
Details
It is a wrapper to cor.test
function.
Examples
#Seed
set.seed(1010)
#Data
x = matrix(rnorm(100 * 20), 100, 20)
y = rnorm(20)
#Compute
rowKendallCor(x = x, y = y)
#> $statistic
#> [1] 88 113 110 93 76 109 115 93 89 64 113 93 55 106 110 58 78 104
#> [19] 75 77 61 101 109 101 77 100 90 96 100 95 93 110 71 81 103 99
#> [37] 85 109 77 83 97 93 87 102 87 96 82 97 92 116 97 62 117 95
#> [55] 97 78 113 89 75 94 103 113 120 94 93 91 101 84 113 103 126 93
#> [73] 80 103 99 85 107 88 109 82 108 55 108 103 94 104 70 63 103 123
#> [91] 120 80 117 120 74 96 84 91 80 76
#>
#> $significance
#> [1] 0.677108239 0.259839989 0.351394858 0.923502331 0.233266557 0.385857151
#> [7] 0.208628398 0.923502331 0.724636221 0.046768937 0.259839989 0.923502331
#> [13] 0.009056382 0.500609627 0.351394858 0.016406081 0.288378196 0.585858446
#> [19] 0.208628398 0.259839989 0.028328627 0.724636221 0.385857151 0.724636221
#> [25] 0.259839989 0.773219475 0.773219475 0.974466903 0.773219475 1.000000000
#> [31] 0.923502331 0.351394858 0.128413511 0.385857151 0.630798946 0.822682885
#> [37] 0.542422145 0.385857151 0.259839989 0.460523794 0.923502331 0.923502331
#> [43] 0.630798946 0.677108239 0.630798946 0.974466903 0.422250282 0.923502331
#> [49] 0.872841460 0.185883043 0.923502331 0.033643947 0.164976406 1.000000000
#> [55] 0.923502331 0.288378196 0.259839989 0.724636221 0.208628398 0.974466903
#> [61] 0.630798946 0.259839989 0.112604127 0.974466903 0.923502331 0.822682885
#> [67] 0.724636221 0.500609627 0.259839989 0.630798946 0.046768937 0.923502331
#> [73] 0.351394858 0.630798946 0.822682885 0.542422145 0.460523794 0.677108239
#> [79] 0.385857151 0.422250282 0.422250282 0.009056382 0.422250282 0.630798946
#> [85] 0.974466903 0.585858446 0.112604127 0.039762137 0.630798946 0.074025729
#> [91] 0.112604127 0.351394858 0.164976406 0.112604127 0.185883043 0.974466903
#> [97] 0.500609627 0.822682885 0.351394858 0.233266557
#>