permutation.test | R Documentation |
For each permutation run, a test statistic for the interaction effect between the treatment and the predicted sensitivity status is computed. A permutation p-value is computed as the proportion of simulations where the test statistic is larger than the test statistic for the original data.
permutation.test(realdata, res, method, reps)
realdata |
Input data (see |
res |
An object of class "rapids" containing the results for the design for the original data. |
method |
An input method ("cvasd" or "cvrs"). |
reps |
Number of permutations. |
Perform permutation test for the real data.
A list of 5:
stat0.group: Statistic for the interaction effect between the treatment and the sensitivity status, for the original data.
treat: A matrix of treatment allocations, one column per permutation run.
sens.pred: A matrix of sesnsitivy statuses, one column per permutation run.
stat.group: A matrix of permutation statistics, one column per permutation run.
ppval.group: P-value from the permutation test.
Svetlana Cherlin, James Wason
analyse.realdata
function.
#Analyse data with "cvrs" method and perform permutation test
data(realdata)
sig = 0.05
group.prop.sig = 0.2
method = "cvrs"
seed = 123
plotrs = T
eta = NULL
R = NULL
G = NULL
realres.cvrs = analyse.realdata(realdata, sig, group.prop.sig, method, eta, R, G, seed, plotrs)
#Permutation test
reps = 10
res.perm = permutation.test(realdata, realres.cvrs, method, reps)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.