Learn R Programming

Shrinkage (version 1.0)

nQs.est: Frequentist estimators.

Description

Frequentist Q1 and Q2 estimators.

Usage

nQs.est(x, y = NULL, opt = "Q1", mu0 = 0, c = 0.5, a = 0.4, b = 0.01, h = 1)
nQ1.est(x, y=NULL, mu0=0, c=0.5, h=1)
nQ2.est(x, y=NULL, mu0=0, c=0.5, a=0.4, b=0.01)

Arguments

x
Input data matrix: features (rows) x samples (columns). See examples.
y
Optional input data matrix.
opt
Option for selecting the type of estimator, it is a character:
"Q1"
Estimator based on the log of the raw estimated fold change. Equivalent function: nQ1.est

"Q2"
Estimator based on the raw p-value that controls test-wise error rate (TWER). Equivalent function: nQ2.est

h
Tuning parameters for Q1 estimator.
a,b
Tuning parameters for Q2 estimator.
c
Tuning parameter for Q1 and Q2 estimator.
mu0
Effect size corresponding to the null hypothesis (i.e. log fold change corresponding to no change, usually 0).

Value

A vector of length equal to the total number of features (i.e. proteins, genes,...).

References

Montazeri, Z., Yanofsky, C. M., & Bickel, D. R. (2010). Shrinkage estimation of effect sizes as an alternative to hypothesis testing followed by estimation in high-dimensional biology: Applications to differential gene expression. Statistical Applications in Genetics and Molecular Biology, 9, 23.

Examples

Run this code
#simulate some data sets: matrices of log-abundance levels
nsam<-5         #number of individuals
nfeat<-6        #number of features (metabolites, genes,...)
diffs<-c(1,4)   #features with differential log-abundance levels
lfc<-5          #differential quantity

# create data matrices; features x samples:
x <- matrix(runif(nfeat*nsam), nrow = nfeat, ncol = nsam) #case
y <- matrix(runif(nfeat*nsam), nrow = nfeat, ncol = nsam) #control
x[diffs,] <- x[diffs,] + lfc


# Q1: ----------
out <- nQs.est(x=x,opt='Q1')
out <- nQ1.est(x=x,y=y,h=0.9)           
out <- nQ1.est(x=x,y=y)              
out <- nQ1.est(x=x,mu0=0.1,c=0.4)  

# Q2: ----------
z1 <- nQs.est(x=x,y=y,opt='Q2',mu0=0.2)
z2 <- nQ2.est(x=x,y=y,c=0.4)            
z3 <- nQ2.est(x=x,a=0.4,b=0.02)  
z4 <- nQ2.est(x=x)

Run the code above in your browser using DataLab