Title: | Computes Exact Bounds of Spearman's Footrule with Missing Data |
---|---|
Description: | Computes exact bounds of Spearman's footrule in the presence of missing data, and performs independence test based on the bounds with controlled Type I error regardless of the values of missing data. Suitable only for distinct, univariate data where no ties is allowed. |
Authors: | Yijin Zeng [aut, cre, cph] |
Maintainer: | Yijin Zeng <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-03-01 05:52:24 UTC |
Source: | https://github.com/cran/bosfr |
Computes bounds of Kendall's tau in the presence of missing data. Suitable only for univariate distinct data where no ties is allowed.
boundsKendall(X, Y)
boundsKendall(X, Y)
X , Y
|
Numeric vectors of data values with potential missing data. No ties in the data is allowed. Inf and -Inf values will be omitted. |
boundsKendall()
computes bounds of Kendall's tau
for partially observed univariate, distinct data. The bounds are computed
by first calculating the bounds of Spearman's footrule (Zeng et al., 2025), and then applying
the combinatorial inequality between Kendall's tau and Spearman's footrule
(Kendall, 1948). See Zeng et al., 2025 for more details.
Let and
be
two vectors of univariate, distinct data.
Kendall's tau is defined as the number of discordant pairs between
and
:
Scaled Kendall's tau is defined as (Kendall, 1948):
bounds |
bounds of Kendall's tau. |
bounds.scaled |
bounds of scaled Kendall's tau. |
Zeng Y., Adams N.M., Bodenham D.A. Exact Bounds of Spearman's footrule in the Presence of Missing Data with Applications to Independence Testing. arXiv preprint arXiv:2501.11696. 2025 Jan 20.
Kendall, M.G. (1948) Rank Correlation Methods. Charles Griffin, London.
Diaconis, P. and Graham, R.L., 1977. Spearman's footrule as a measure of disarray. Journal of the Royal Statistical Society Series B: Statistical Methodology, 39(2), pp.262-268.
### compute bounds of Kendall's tau between incomplete ranked lists X <- c(1, 2, NA, 4, 3) Y <- c(3, NA, 4, 2, 1) boundsKendall(X, Y) ### compute bounds of Kendall's tau between incomplete vectors of distinct data X <- c(1.3, 2.6, NA, 4.2, 3.5) Y <- c(5.5, NA, 6.5, 2.6, 1.1) boundsKendall(X, Y)
### compute bounds of Kendall's tau between incomplete ranked lists X <- c(1, 2, NA, 4, 3) Y <- c(3, NA, 4, 2, 1) boundsKendall(X, Y) ### compute bounds of Kendall's tau between incomplete vectors of distinct data X <- c(1.3, 2.6, NA, 4.2, 3.5) Y <- c(5.5, NA, 6.5, 2.6, 1.1) boundsKendall(X, Y)
Computes exact bounds of Spearman's footrule in the presence of missing data, and performs independence test based on the bounds with controlled Type I error regardless of the values of missing data. Suitable only for univariate distinct data where no ties is allowed.
boundsSFR(X, Y, pval = TRUE)
boundsSFR(X, Y, pval = TRUE)
X |
Numeric vector of data values with potential missing data. No ties in the data is allowed. Inf and -Inf values will be omitted. |
Y |
Numeric vector of data values with potential missing data. No ties in the data is allowed. Inf and -Inf values will be omitted. |
pval |
Boolean for whether to compute the bounds of p-value or not. |
boundsSFR()
computes exact bounds of Spearman's footrule
for partially observed univariate, distinct data using the results and
algorithms following Zeng et al., 2025.
Let and
be
two vectors of univariate, distinct data, and denote the rank of
in
as
, the rank of
in
as
.
Spearman's footrule is defined as the absolute distance between the ranked
values of
and
:
Scaled Spearman's footrule is defined as:
When is odd,
, but when
is
even,
(Kendall, 1948).
The p-value of the independence test using Spearman's footrule, denoted
as , is computed using the normality approximation result in Diaconis, P., & Graham, R. L. (1977).
If
pval = TRUE
, bounds of the p-value, will be
computed in the presence of missing data, such that
.
The independence test method proposed in Zeng et al., 2025 returns
as its p-value.
This method controls the Type I error regardless of the values of missing data.
See Zeng et al., 2025 for details.
bounds |
exact bounds of Spearman's footrule. |
bounds.scaled |
exact bounds of scaled Spearman's footrule. |
pvalue |
the p-value for the test. (Only present if argument |
bounds.pvalue |
bounds of the p-value of independence test using Spearman's footrule. (Only present if argument |
Zeng Y., Adams N.M., Bodenham D.A. Exact Bounds of Spearman's footrule in the Presence of Missing Data with Applications to Independence Testing. arXiv preprint arXiv:2501.11696. 2025 Jan 20.
Kendall, M.G. (1948) Rank Correlation Methods. Charles Griffin, London.
Diaconis, P. and Graham, R.L., 1977. Spearman's footrule as a measure of disarray. Journal of the Royal Statistical Society Series B: Statistical Methodology, 39(2), pp.262-268.
### compute exact bounds of Spearman's footrule between incomplete ranked lists X <- c(1, 2, NA, 4, 3) Y <- c(3, NA, 4, 2, 1) boundsSFR(X, Y, pval=FALSE) ### compute exact bounds of Spearman's footrule between incomplete vectors of distinct data, ### and perform independence test X <- c(1.3, 2.6, NA, 4.2, 3.5) Y <- c(5.5, NA, 6.5, 2.6, 1.1) boundsSFR(X, Y, pval=TRUE)
### compute exact bounds of Spearman's footrule between incomplete ranked lists X <- c(1, 2, NA, 4, 3) Y <- c(3, NA, 4, 2, 1) boundsSFR(X, Y, pval=FALSE) ### compute exact bounds of Spearman's footrule between incomplete vectors of distinct data, ### and perform independence test X <- c(1.3, 2.6, NA, 4.2, 3.5) Y <- c(5.5, NA, 6.5, 2.6, 1.1) boundsSFR(X, Y, pval=TRUE)