power: Empirical power analysis

Description Usage Arguments Value Examples

Description

This function deals with power analysis by calculating the relevant TypeI error, power, and probability of being significant by given global false discovery rate.

Usage

1
2
3
power(q, x, w = NULL, a = NULL, precision = 1e-08, MaxIter = 10000L,
  theta = NULL, alpha = 0.9, type = c("left tail area", "pvalue"),
  rel.tol = .Machine$double.eps^0.25, tol = .Machine$double.eps^0.5)

Arguments

q

A numeric value or a vector of numerical value, represent global false discovery rate used for power analysis.

x

A vector of numeric values, represent p-values or left-tail areas of test statistics from a differential gene expression study.

w

A vector of two numeric values, represent the weights of the uniform and Beta distributions. See UBMM.

a

A vector of two initial parameter values for Beta distribution. See UBMM.

precision

The precision for convergence. Default value is 1e-8.

MaxIter

The maximum iteration for the EM algorhthm.

theta

A numerical value, represents the exponential tilting parameter for the fitted mixture model from x. Defualt is NULL.

alpha

A numeric value, used to determine the probably null region in method “m1" (see tqvalue). Default is 0.9.

type

A character value, chosen from “left tail area” and “pvalue”. Default is “left tail area”.

rel.tol

the accuracy used in integrate.

tol

the accuracy used in uniroot.

Value

A dataframe consists of q, TypeI, Power, ProbS, respectively. TypeI, Power, and ProbS are calculated based on the rejection region R(q) and the empirical mixture model for x.

q

The global false discovery rates provided in arguments.

TypeI

P(R(q)|H_0)

power

P(R(q)|H_1)

ProbS

P(R(q))

If theta is provided, then the results contain two data frames as above, one is calculated from the non-exponential tilted mixture model and the other from the exponential tilted mixture model, respectively.

Examples

1
2
3
4
5
6
7
x=c(rbeta(50,0.5,0.5),runif(950))
q=seq(0.05,0.95,0.05)
## Not run: 
power(q,x,alpha=0.9,type="left tail area")
power(q,x,theta=2,alpha=0.9,type="left tail area")

## End(Not run)

chongma1989/tiltmod documentation built on May 7, 2019, 8:38 a.m.