tStar | R Documentation |
Computes the t* U-statistic for input data pairs (x_1,y_1), (x_2,y_2), ..., (x_n,y_n) using the algorithm developed by Heller and Heller (2016) <arXiv:1605.08732> building off of the work of Weihs, Drton, and Leung (2015) <DOI:10.1007/s00180-015-0639-x>.
tStar(x, y)
x |
A numeric vector of x values (length >= 4). |
y |
A numeric vector of y values, should be of the same length as x. |
The numeric value of the t* statistic.
Bergsma, Wicher; Dassios, Angelos. A consistent test of independence based
on a sign covariance related to Kendall's tau. Bernoulli 20 (2014),
no. 2, 1006–1028.
Heller, Yair and Heller, Ruth. "Computing the Bergsma Dassios
sign-covariance." arXiv preprint arXiv:1605.08732 (2016).
Weihs, Luca, Mathias Drton, and Dennis Leung. "Efficient Computation of the
Bergsma-Dassios Sign Covariance." arXiv preprint arXiv:1504.00964 (2015).
## Not run:
library(TauStar)
# Compute t* for a concordant quadruple
tStar(c(1,2,3,4), c(1,2,3,4)) # == 2/3
# Compute t* for a discordant quadruple
tStar(c(1,2,3,4), c(1,-1,1,-1)) # == -1/3
# Compute t* on random normal iid normal data
set.seed(23421)
tStar(rnorm(4000), rnorm(4000)) # near 0
# Compute t* as a v-statistic
set.seed(923)
tStar(rnorm(100), rnorm(100), vStatistic = TRUE)
# Compute an approximation of tau* via resampling
set.seed(9492)
tStar(rnorm(10000), rnorm(10000), resample = TRUE, sampleSize = 30,
numResamples = 5000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.