Learn R Programming

StatMethRank (version 1.3)

independence.test: Nonparametric Rank Tests for Independence

Description

This function performs a nonparametric test of ranking data based on the correlation. This function can be applied to the ranking data with missing ranks and tie ranks.

Usage

independence.test(X1, X2, method = c("spearman", "kendall"))

Arguments

X1
a vector, using NA to stand for the missing ranks
X2
the same as X1
method
whether the test is based on Spearman correlation or Kendall correlation

Value

a list of the test statistics

References

Rank Correlation Methods for Missing Data, Mayer Alvo and Paul Cablio Nonparametric Rank Tests for Independence in Opinion Surveys, Philip L.H. Yu, K.F. Lam, and Mayer Alvo

Examples

Run this code
Arith = c(14, 18, 23, 26, 27, 30, 40, NA, NA)
Lang = c(28, 14, 46, NA, 53, NA, 54, 50, NA)
independence.test(Arith, Lang, method = "spearman")
independence.test(Arith, Lang, method = "kendall")

Run the code above in your browser using DataLab