permute_pvalue: Calculation of permutation p-value

Description Usage Arguments Value Examples

View source: R/permute_pvalue.R

Description

Calculates the permutation p-value 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.

Usage

1
permute_pvalue(dat, permuteN, method = "F")

Arguments

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 c("nu","de","F"), which corresponde to the numerator, denominator and F-statistics criteria respectively. The default method is the F-statistics method.

Value

perm_p Permutation p-value for the data and choosen criterior

p A vector of calculated p-value for the original and permuted data set under the choosen criterior

Examples

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")

suzhesuzhe/GEM documentation built on May 26, 2017, 11 p.m.