Description Usage Arguments Value Author(s) References See Also Examples
View source: R/mrpp.test.dist.R
K-sample MRPP test
1 2 3 4 5 6 7 |
y |
A N*P data matrix, |
trt |
A vector of treatment assignments. If missing, the first permutation in |
B |
A positive integer number of permutations requested. This will only be used when |
permutedTrt |
An optional permutation index matrix. If missing, this will be computed as |
wtmethod |
0 or 1, where 0 stands for weighting each treatment group by sample size - 1, and 1 stands for weighting by sample size. |
eps |
A small non-negative number, differences below which among permuted test statistics are treated as equal. |
data |
A data frame in which variables in the formula can be found. |
... |
Additional arguments passed to the methods. |
An htest
object with the following components:
statistic |
The observed test statistic. |
all.statistics |
All permuted test statistics. |
p.value |
The permutation p-value. |
parameter |
A vector of the number of permutations and the weighting method. |
data.name |
The character name of the data. |
method |
A string of test method. |
Long Qu
Paul W. Mielke, Kenneth J. Berry. (2007) Permutation Methods: A Distance Function Approach. 2nd ed. Springer.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | set.seed(2340)
x=matrix(rnorm(20*5),20)
trt=gl(2,10)
nparts( table(trt)) ## 92378 partitions = choose(20,10)/2
urand.bigz(0,seed=1032940L) # init seed
pmat=permuteTrt(trt, 5e2L) ## use 500 random permutations
## Not run:
pmat=permuteTrt(trt, 1e6L) ## use all partitions, as 1e6L >= 92378
## End(Not run)
### Distance matrix interface
mrpp.test(dist(x), trt, permutedTrt=pmat, wtmethod=0 )
### Data matrix interface
mrpp.test(x, trt, permutedTrt=pmat, wtmethod=0 )
### Formula interface
dat=data.frame(x, trt)
fmla=as.formula(sprintf('cbind(%s)~trt',paste('X',1:5,sep='',collapse=',')))
mrpp.test(fmla, dat, permutedTrt=pmat, wtmethod=0 )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.