Performs the test that a group of variables is independent of an other based on marginal ranks. Three different score functions are available.
ind.ctest(X, index1, index2 = NULL, scores = "rank",
na.action = na.fail)
A list with class 'htest' containing the following components:
the value of the W-statistic.
the degrees of freedom for the W-statistic.
the p-value for the test.
a character string indicating what type of test was performed.
a character string giving the name of the data.
a data frame or matrix.
integer vector that selects the columns of X
that form group one. Only numeric columns can be selected.
integer vector that selects the columns of X
that form group two. Only numeric columns can be selected.
If NULL
, all remaining columns of X will be selected.
if 'sign', a sign test is performed, if 'rank' a rank test is performed or if 'normal' a normal score test is performed.
a function which indicates what should happen when the data contain 'NA's. Default is to fail.
Klaus Nordhausen
The test tests if X[ , index1] is independent of X[ , index2] and is described in great detail in Puri and Sen (1971).
Puri , M.L. and Sen, P.K. (1971), Nonparametric Methods in Multivariate Analysis, New York: Wiley.
A1 <- matrix(c(4, 4, 5, 4, 6, 6, 5, 6, 7), ncol = 3)
A2 <- matrix(c(0.5, -0.3, -0.3, 0.7), ncol = 2)
X <- cbind(rmvnorm(100, c(-1, 0, 1), A1), rmvnorm(100, c(0, 0), A2))
ind.ctest(X,1:3)
ind.ctest(X, c(1, 5), c(2, 3), scores = "normal")
Run the code above in your browser using DataLab