Description Usage Arguments Details Value See Also Examples
Takes vectors of estimates (betahat) and their standard errors (sebetahat), together with degrees of freedom (df) and applies shrinkage to them, using Empirical Bayes methods, to compute shrunk estimates for beta.
1 2 |
betahat |
a p vector of estimates |
sebetahat |
a p vector of corresponding standard errors |
mixcompdist |
distribution of components in mixture ("uniform","halfuniform" or "normal"; "+uniform" or "-uniform"), the default is "uniform". If you believe your effects may be asymmetric, use "halfuniform". If you want to allow only positive/negative effects use "+uniform"/"-uniform". The use of "normal" is permitted only if df=NULL. |
df |
appropriate degrees of freedom for (t) distribution of betahat/sebetahat, default is NULL which is actually treated as infinity (Gaussian) |
... |
Further arguments to be passed to
|
This function is actually just a simple wrapper that
passes its parameters to ash.workhorse
which
provides more documented options for advanced use. See readme
for more details.
ash returns an object of class
"ash", a list with some or all of the following elements (determined by outputlevel)
fitted_g |
fitted mixture |
loglik |
log P(D|fitted_g) |
logLR |
log[P(D|fitted_g)/P(D|beta==0)] |
result |
A dataframe whose columns are |
A vector of posterior probability that beta is negative
A vector of posterior probability that beta is positive
A vector of estimated local false sign rate
A vector of estimated local false discovery rate
A vector of q values
A vector of s values
A vector consisting the posterior mean of beta from the mixture
A vector consisting the corresponding posterior standard deviation
call |
a call in which all of the specified arguments are specified by their full names |
data |
a list containing details of the data and models used (mostly for internal use) |
fit_details |
a list containing results of mixture optimization, and matrix of component log-likelihoods used in this optimization |
ash.workhorse
for complete specification of ash function
ashci
for computation of credible intervals after getting the ash object return by ash()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | beta = c(rep(0,100),rnorm(100))
sebetahat = abs(rnorm(200,0,1))
betahat = rnorm(200,beta,sebetahat)
beta.ash = ash(betahat, sebetahat)
names(beta.ash)
head(beta.ash$result) # the main dataframe of results
graphics::plot(betahat,beta.ash$result$PosteriorMean,xlim=c(-4,4),ylim=c(-4,4))
CIMatrix=ashci(beta.ash,level=0.95)
print(CIMatrix)
#Illustrating the non-zero mode feature
betahat=betahat+5
beta.ash = ash(betahat, sebetahat)
graphics::plot(betahat,beta.ash$result$PosteriorMean)
betan.ash=ash(betahat, sebetahat,mode=5)
graphics::plot(betahat, betan.ash$result$PosteriorMean)
summary(betan.ash)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.