getEfronp | R Documentation |
Estimation of empirical null distribution using Efron's central matching.
getEfronp(
z,
bins = 120L,
maxQ = 9,
pct = 0,
pct0 = 0.25,
cc = 1.2,
plotIt = FALSE
)
z |
A numeric vector of z values following the theoretical normal null distribution. |
bins |
The number of intervals for density estimation of the marginal density of z. |
maxQ |
The maximum degree of the polynomial to be considered for density estimation of the marginal density of z. |
pct |
Low and top (pct*100) f(z). |
pct0 |
Low and top (pct0*100) estimate f0(z). |
cc |
The central parts
of the empirical distribution z are used for an estimate of the null proportion (eta). |
plotIt |
TRUE if density plot is to be produced. |
A list containing
correctz |
The corrected z values to follow empirically standard normal distribution. |
correctp |
The corrected p values using the correct z values. |
q |
The chosen degree of polynomial for the estimated marginal density. |
mu0hat |
The location parameter for the normal null distribution. |
sigma0hat |
The scale parameter for the normal null distribution. |
eta |
The estimated null proportion. |
Min Jin Ha
Efron, B. (2004). Large-scale simultaneous hypothesis testing. Journal of the American Statistical Association, 99, 96–104.
Ha, M. J. and Sun, W. (2014). Partial correlation matrix estimation using ridge penalty followed by thresholding and re-estimation. Biometrics, 70, 762–770.
p <- 100 # number of variables
n <- 50 # sample size
###############################
# Simulate data
###############################
simulation <- simulateData(G = p, etaA = 0.02, n = n, r = 1)
data <- simulation$data[[1]]
stddata <- scale(x = data, center = TRUE, scale = TRUE)
###############################
# estimate ridge parameter
###############################
lambda.array <- seq(from = 0.1, to = 20, by = 0.1) * (n - 1.0)
fit <- lambda.cv(x = stddata, lambda = lambda.array, fold = 10L)
lambda <- fit$lambda[which.min(fit$spe)] / (n - 1.0)
###############################
# calculate partial correlation
# using ridge inverse
###############################
w.upper <- which(upper.tri(diag(p)))
partial <- solve(lambda * diag(p) + cor(data))
partial <- (-scaledMat(x = partial))[w.upper]
###############################
# get p-values from empirical
# null distribution
###############################
efron.fit <- getEfronp(z = transFisher(x = partial))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.