Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ashci

Credible Interval Computation for the ash object


Description

Given the ash object returned by the main function ash, this function computes a posterior credible interval (CI) for each observation. The ash object must include a data component to use this function (which it does by default).

Usage

ashci(
  a,
  level = 0.95,
  betaindex,
  lfsr_threshold = 1,
  tol = 0.001,
  trace = FALSE
)

Arguments

a

the fitted ash object

level

the level for the credible interval, (default=0.95)

betaindex

a vector consisting of locations of betahat where you would like to compute the credible interval

lfsr_threshold

a scalar, if specified then computes CIs only for observations more significant than that threshold.

tol

passed to uniroot; indicates desired accuracy.

trace

a logical variable denoting whether some of the intermediate results of iterations should be displayed to the user. Default is FALSE.

Details

Uses uniroot to find credible interval, one at a time for each observation. The computation cost is linear in number of observations.

Value

A matrix, with 2 columns, ith row giving CI for ith observation

Examples

beta = c(rep(0,20),rnorm(20))
sebetahat = abs(rnorm(40,0,1))
betahat = rnorm(40,beta,sebetahat)
beta.ash = ash(betahat, sebetahat)

CImatrix=ashci(beta.ash,level=0.95)

CImatrix1=ashci(beta.ash,level=0.95,betaindex=c(1,2,5))
CImatrix2=ashci(beta.ash,level=0.95,lfsr_threshold=0.1)

ashr

Methods for Adaptive Shrinkage, using Empirical Bayes

v2.2-47
GPL (>= 3)
Authors
Matthew Stephens [aut], Peter Carbonetto [aut, cre], Chaoxing Dai [ctb], David Gerard [aut], Mengyin Lu [aut], Lei Sun [aut], Jason Willwerscheid [aut], Nan Xiao [aut], Mazon Zeng [ctb]
Initial release
2020-02-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.