stramash: stramash

Description Usage Arguments Details Value See Also Examples

Description

The main function in the stramash package is stramash, which should be examined for more details. For simplicity only the most commonly-used options are documented under stramash. For expert or interested users the documentation for function stramash.workhorse provides documentation on all implemented options.

Takes vectors of estimates (betahat) and their standard errors (sebetahat) or a list of mixture error distributions (errordist), and applies shrinkage to them, using Empirical Bayes methods, to compute shrunk estimates for beta.

Usage

1
2
3
stramash(betahat, errordist = NULL, sebetahat = NULL,
  likelihood = c("normal", "t", "laplace"), mixcompdist = c("uniform",
  "halfuniform", "normal", "+uniform", "-uniform"), df = NULL, ...)

Arguments

betahat

a p vector of estimates

errordist

A list of objects of either class normalmix or unimix. The length of this list must be the length of betahat. Note that errordist[[i]] is the ith error distribution of betahat[i]. Defaults to NULL, in which case stramash.workhorse will assume either a normal, t, or Laplace likelihood, depending on the value for likelihood.

sebetahat

a p vector of corresponding standard errors

likelihood

One of the pre-specified likelihoods available. So far, they are "normal", "t", and "laplace".

mixcompdist

distribution of components in mixture ("uniform", "halfuniform", "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".

df

appropriate degrees of freedom for (t) distribution of betahat/sebetahat if likelihood = "t".

...

Further arguments to be passed to stramash.workhorse.

Details

This function is actually just a simple wrapper that passes its parameters to stramash.workhorse which provides more documented options for advanced use. See README.md for more details.

Value

stramash returns an object of class "ash", a list with some or all of the following elements (determined by outputlevel)

fitted.g

fitted mixture, either a normalmix or unimix

loglik

log P(D|mle(pi))

logLR

log[P(D|mle(pi))/P(D|beta==0)]

PosteriorMean

A vector consisting the posterior mean of beta from the mixture

PosteriorSD

A vector consisting the corresponding posterior standard deviation

PositiveProb

A vector of posterior probability that beta is positive

NegativeProb

A vector of posterior probability that beta is negative

ZeroProb

A vector of posterior probability that beta is zero

lfsr

The local false sign rate

lfdr

A vector of estimated local false discovery rate

qvalue

A vector of q values

call

a call in which all of the specified arguments are specified by their full names

excludeindex

the vector of index of observations with 0 standard error; if none, then returns NULL

model

either "EE" or "ET", denoting whether exchangeable effects (EE) or exchangeable T stats (ET) has been used

optmethod

the optimization method used

data

a list consisting the input betahat and sebetahat (only included if outputlevel>2)

See Also

stramash.workhorse for complete specification of stramash function

Examples

1
2
3
4
5
6
7
beta = c(rep(0, 100), stats::rnorm(100))
sebetahat = abs(stats::rnorm(200, 0, 1))
betahat = stats::rnorm(200, beta, sebetahat)
beta.stramash = stramash.workhorse(betahat = betahat, sebetahat = sebetahat)
summary(beta.stramash)
names(beta.stramash)
graphics::plot(betahat, beta.stramash$PosteriorMean, xlim = c(-4, 4), ylim = c(-4, 4))

dcgerard/stramash documentation built on May 15, 2019, 1:24 a.m.