Create a data object for mash analysis.
An N by R matrix of observed estimates.
An N by R matrix of corresponding standard errors. Shat can be a scalar if all standard errors are equal. This is most useful if Bhat is a matrix of Z scores, so elements of Shat are all 1. Default is 1.
Numeric value of alpha parameter in the model. alpha = 0 for Exchangeable Effects (EE), alpha = 1 for Exchangeable Z-scores (EZ). Default is 0. Please refer to equation (3.2) of M. Stephens 2016, Biostatistics for a discussion on alpha.
An N by R matrix of corresponding degrees of freedom of the t-statistic Bhat/Shat. Can be a scalar if all degrees of freedom are equal. Default is inf (for large samples).
An N by R matrix of p-values of t-statistic Bhat/Shat. Shat and df should not be specified when pval is provided.
an R by R matrix / [R x R x N] array of effect specific correlation matrix of error correlations; must be positive definite. [So Bhat_j distributed as N(B_j,diag(Shat_j) V[,,j] diag(Shat_j)) where _j denotes the jth row of a matrix]. Defaults to identity.
a small positive number as threshold for Shat to be considered zero if any Shat is smaller or equal to this number.
Replace zeros in Shat matrix to given value if the corresponding Bhat are also zeros.
Replace zeros in Shat matrix to given value.
A data object for passing into mash functions.
simdata = simple_sims(50,5,1)
data = mash_set_data(simdata$Bhat, simdata$Shat)