Description Usage Arguments Details Value See Also Examples
This function caculates the null distribution of the weighted contrast W_j.
1 | wj2.permuted(data, ret, nB = 99, contrast = NULL, seed = 1234)
|
data |
The dataset, an n by m numeric matrix, where n is number of observations and m the dimension of data |
ret |
The return list of function emmixwire |
nB |
The number of permutations |
contrast |
A two- or three- dimensional vector the contrast(s) for the class differences |
seed |
random seed for the permutations. |
The number of classes of samples is either two or three, and the default contrast for two classes is c(1, -1), and three classes c(1, 0, -1).
An n by nB matrix with its columns as the statistic Wj for each permutation.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data(hedenlc)
dat<-hedenlc[seq_len(100),] #for speed
set.seed(123456)
ret <-emmixwire(dat, g=3, ncov=3, nvcov=1, n1=7, n2=8,
debug=1, itmax=20, epsilon=1e-5)
###calculate the W_j
wj <- scores.wire(ret, contrast=c(1, -1))
### the null distribution of W_j
wj0 <- wj2.permuted(dat, ret, nB=19)
### the p-values of W_j
pv <- pvalue.wire(wj, wj0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.