Description Usage Arguments Value Examples
View source: R/permute_pvalue.R
Calculates the permutation pvalue for a fitted GEM. See more detail in E Petkova, T Tarpey, Z Su, and RT Ogden. Generated effect modifiers (GEMs) in randomized clinical trials. Biostatistics, (First published online: July 27, 2016). doi: 10.1093/biostatistics/kxw035.
1  permute_pvalue(dat, permuteN, method = "F")

dat 
Data frame with first column as the treatment index, second column as the outcome, and the remaining columns as the covariates design matrix. The elements of the treatment index take K distinct values, where K is the number of treatment groups. The outcome has to be a continuous variable. 
permuteN 
Number of permutation 
method 
Choice of the criterion that the generated effect modifier optimizes. This is a string in

perm_p
Permutation pvalue for the data and choosen criterior
p
A vector of calculated pvalue for the original and permuted data set under the choosen criterior
1 2 3 4 5 6 7 8 9  #constructing the covariance matrix
co < matrix(0.2, 10, 10)
diag(co) < 1
#simulate a data set
dataEx < data_generator1(d = 0.3, R2 = 0.5, v2 = 1, n = 300,
co = co, beta1 = rep(1,10),inter = c(0,0))
#calculate the permuted p value
dat < dataEx[[1]]
permute_pvalue(dat, permuteN = 200, method = "nu")

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.