simulate.data: Simulate p-values and covariates under various scenarios.

Description Usage Arguments Value Author(s) References Examples

Description

The function simulates p-values and covariates under different signal structures (density and strength) and covariate models. It also allows special correlation structures among the p-values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## S3 method for class 'data'
simulate(
  paras.mapping = paras.mapping.func(),
  covariate.strength = c("None", "Moderate", "Strong"),
  covariate.model = c("pi0", "f1", "both"),
  covariate.dist = c("Normal", "Uniform", "T"),
  null.model = c("Unif", "Left", "Right"),
  skewness = 0.15,
  f1.sd = 1,
  feature.no = 10000,
  sig.dist = c("Normal", "Gamma"),
  sig.density = c("Low", "Medium", "High"),
  sig.strength = c("L1", "L2", "L3", "L4", "L5", "L6", "L7", "L8"),
  cor.struct = c("None", "Block", "AR1"),
  cor.rho = 0,
  cor.sign = c("PosCor", "PosNegCor"),
  cor.nblock = 500
)

Arguments

paras.mapping

a list with slots 'sig.strengths', 'sig.densities', 'pi.strengths', 'f1.strengths', which define the actual numeric values used for different levels of 'sig.strength', 'sig.density', 'covariate.strength'. 'covariate.strength' consists of both 'pi.strengths' and 'f1.strengths'. The mapping can be generated by using the paras.mapping.func function.

covariate.strength

a character string from 'None', 'Moderate', 'Strong' indicating the covariate strength.

covariate.model

a character string from 'pi0', 'f1', 'both' indicating whether the prior null proability, the alterantive distribution or both are affected by the covariate.

covariate.dist

a character string from 'Normal', 'Uniform', 'T' indicating the distribution of the covariate. For t-distribution, a degree of freedom of five is used.

null.model

a character string from 'Unif', 'Left', 'Right' indicating whether the null distribution of the p-value is uniform, left skewed or right skewed.

skewness

a numeric value indicating the skewness of the p-value distribution under the null (mean of the z-value)

f1.sd

a numeric value indicating the variance of the z-score under the alternative. Default is 1.

feature.no

an integar, the number of features to be simulated.

sig.dist

a character string from 'Normal', 'Gamma' indicating the distribution of the z-value under alternative.

sig.density

a character string from 'Low', 'Medium', 'High' indicating the level of signal density.

sig.strength

a character string from 'L1', 'L2', 'L3', 'L4', 'L5', 'L6', 'L7', 'L8' indicating the level of signal strength.

cor.struct

a character string from 'None', 'Block', 'AR1' indicating the correlation structure to be simulated including no correlation, block correlation and AR(1) correlation.

cor.rho

a numeric value giving the correlation coefficient for 'Block', 'AR1'.

cor.sign

a character string from 'PosCor', 'PosNegCor' indicating whether to simulate only positive or both postive and negative correlations.

cor.nblock

an integar, the number of blocks to be simulated for block correlation structure

Value

A list with the elements

pvals

a numeric vector of p-values.

pi0.var

a vector of covariate values for the prior null probability.

f1.var

a vector of covariate values for the alternative distribution.

pi0

a vector of the simulated null probabilities.

truth

a vector simulated truth for H0 (=0) or H1 (=1).

lfdr

a vector of oracle LFDR based on the simulated pi0, f1.

fdr

a vector of oracle FDR based on LFDR.

Author(s)

Jun Chen

References

Xianyang Zhang, Jun Chen. Covariate Adaptive False Discovery Rate Control with Applications to Omics-Wide Multiple Testing. JASA. To appear.

Examples

1
2
3
4
5
6
data <- simulate.data(feature.no = 10000, covariate.strength = 'Moderate', covariate.model = 'pi0',
	sig.density = 'Medium', sig.strength = 'L3', cor.struct = 'None')
camt.fdr.obj <- camt.fdr(pvals = data$pvals, pi0.var = data$pi0.var, f1.var = data$f1.var, 
	alg.type = 'EM', control.method = 'knockoff+')
plot.camt.fdr(camt.fdr.obj, covariate = as.vector(rank(data$pi0.var)), covariate.name = 'Covariate rank',
	log = TRUE, file.name = 'CovariateModerate.pdf')

jchen1981/CAMT documentation built on Jan. 2, 2021, 1:44 p.m.