Learn R Programming

pi0 (version 1.4-1)

extrp.pi0: Extrapolate the Estimates of P-value Density at 1 from Subsamples to Estimate the Proportion of True Nulls

Description

This is the second step of the Subsampling-Extrapolation (SubEx) procedure for estimating the proportion of TRUE null hypotheses, i.e., pi0, when a large number of two-sample t-tests are simultaneously performed. It regresses the p-value density estimates at 1 from subsamples over various subsample sizes and extrapolates the curve/plane to infinite sample sizes in each treatment group. This estimated limit is used to estimate pi0.

Usage

extrp.pi0(dat,slope.constraint=TRUE, gamma2.range=2^c(-4,3),
         rate.margin=c(0.5,0.5), plotit=TRUE) 
extrp.pi0.only(n1,n2,y,gam2)
extrp.pi0.slope(n1,n2,y,gam2,eps=1e-5)
extrp.pi0.rate(n1,n2,y,gam2,rate.interval=c(.3,2),eps=1e-5)
extrp.pi0.both(n1,n2,y,gam2,rate.interval=c(.3,2),eps=1e-5)
extrp.pi0.gam2(n1,n2,y,gam2.interval=c(1e-3,6))
extrp.pi0.slope.gam2(n1,n2,y,gam2.interval=c(1e-3,6),eps=1e-5)
extrp.pi0.rate.gam2(n1,n2,y,gam2.interval=c(1e-3,6),rate.interval=c(.3,2),eps=1e-5)
extrp.pi0.both.gam2(n1,n2,y,gam2.interval=c(1e-3,6),rate.interval=c(.3,2),eps=1e-5)

Arguments

dat

an object of class subt; typically resulting from calling the function subt.

slope.constraint

logical: whether slope \(a\) should be constrained to be positive

gamma2.range, gam2.interval

a numeric vector of length 2, defining the appropriate range of the gamma square parameter. When they are equal, it is assumed as known.

rate.margin

a numeric vector of length 2, defining the margin of \(c\) parameter. When they are equal, it is assumed as known.

plotit

logical: whether plot should be produced

n1,n2

subsample size vectors for each of the two treatment groups.

y

a numeric vector of estimated pi0 at the corresponding subsample sizes.

gam2

gamma square value, assumed to be known.

rate.interval

a numeric vector of length 2 defining the appropriate range of rate parameter.

eps

a small number of tolerance.

Value

an object of class extrpi0, which is a numeric vector of length 1, named "pi0", giving the estimated \(\pi_0\), with the following attributes:

attr(,'fitted.obj')

a list, which is the object returned by FUN.

attr(,'nparm')

the same as the first element of nparm.

attr(,'extrpFUN')

the same as FUN.

attr(,'start.val')

the first nparm elements of starts.

attr(,'subt.data')

the same as dat.

Details

Two regression functions may be used, as specified by nparm. One is assuming the nonzero standardized effect sizes have a marginal distribution of zero mean normal distribution with variance \(\gamma^2\). This regression function has two parameters, $$f_1 =(1-\pi_0)\sqrt{\frac{n_1+n_2}{n_1+n_2+n_1 n_2 \gamma^2}}+\pi_0$$ where \(f_1\) is the density estimates at 1 for subsamples, \(n_1\) and \(n_2\) are the corresponding subsampling sizes, \(0 \le \pi_0 \le 1\), and \(\gamma^2 > 0\). The other regression function is more flexible by replacing the square root and the \(1-\pi_0\) term with another two parameters: $$f_1 =a \left(\frac{n_1+n_2}{n_1+n_2+n_1 n_2 \gamma^2}\right)^c+\pi_0$$ subject to additional constraints of \(a>0\) and \(c>0\).

It is highly recommended to have rgl package available to display the estimated regression surface and possibly rotate it with the mouse.

References

Qu, L., Nettleton, D., Dekkers, J.C.M. Subsampling Based Bias Reduction in Estimating the Proportion of Differentially Expressed Genes from Microarray Data. Unpublished manuscript.

See Also

subt, subex, constrOptim, optimize, lsei, print.extrpi0, plot.extrpi0.

Examples

Run this code
# NOT RUN {
set.seed(9992722)
## this is how the 'simulatedDat' data set in this package generated
simulatedDat=sim.dat(G=5000)	
## this is how the 'simulatedSubt' object in this package generated
simulatedSubt=subt(simulatedDat,balanced=FALSE,max.reps=Inf)
## this is how the 'simulatedExtrpi0' data set in this package generated
simulatedExtrpi0=extrp.pi0(simulatedSubt)
# }
# NOT RUN {
data(simulatedExtrpi0)
summary(simulatedExtrpi0)
# }

Run the code above in your browser using DataLab