multkw.perm | R Documentation |
This function computes an "extended" multivariate Kruskal-Wallis test for n numeric variables (which can contain NA's) relative to one factorial variable (that subsets the dataset in groups)
multkw.perm(nmc, group, y, r, weight, print = TRUE)
nmc |
Number of Monte-Carlo permutations to do. |
group |
The factorial variable that subsets the dataset in groups. Can be a character vector, a factorial vector or an integer/numeric vector. |
y |
The dataset of n numeric(or integer) variables. |
r |
Optional. The missing data pattern to be applied. If dataset has |
weight |
Optional. The weighting scheme to be used to compute the final value of the test statistic. As test statistics are calculated for each pattern of missingness, there are as statistics as patterns. The final test statistic can thus be the arithmetic mean of each statistic ( |
print |
Whether the test should be printed ( |
"Likelihood-based" and "permutation-based" multivariate Kruskal-Wallis tests are computed: in large samples, the distribution of the test statistic approximates that of the khi?, but in smaller samples, a more accurate p-value is obtained by computing an "empirical" distribution of the test statistic by doing a Monte-Carlo sampling with permutations.
Firstly, the "multivariate Kruskal-Wallis test with missing data" is computed and are the first half of the outputs; they are the "likelihood-based" test results (see documentation of multkw.m
for more details).
Thus, a Monte-Carlo sampling with permutations (by randomly assigning individuals to groups) is computed, and the second half of the outputs are the proportions of results that exceeds the previously observed results (with the likelihood-based test).
Returns a list of results of the various multivariate Kruskal-Wallis tests that have been computed. The results are the test statistics (W2), the degrees of freedom (df) and the p-value of the test statistic. These three results are given for (1) a "classical" multivariate Kruskal-Wallis test, i.e. on data without missing values; each test statistic is thus followed by a .c for "complete" and (2) a global multivariate Kruskal-Wallis test that takes into account missing values (see details); each test statistic is thus followed by a .m for "missing".
Fanyin He (most of the statistical function)
Jacob Maugoust (packaging)
He.etal.2017ULT
See chapter 2.2.2 and 4.2 of the PhD manuscript of Fanyin He and 'Methodology' of \insertCiteHe.etal.2017;textualULT for more details.
data(airquality)
datamkw<-airquality[,1:4]
multkw(y=datamkw,airquality$Month)
multkw.m(y=datamkw,airquality$Month)
multkw.perm(y=datamkw,airquality$Month,nmc=100)
multkw.perm(y=datamkw,airquality$Month,nmc=10000)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.