get_posterior_condition_wise_summary | R Documentation |
Provide condition-wise summary based on posterior distributions for each effect.
get_posterior_condition_wise_summary(mash_data, m, contrast_mat)
mash_data |
A mash data object, e.g. as created by |
m |
A mash fit, typically an output from |
contrast_mat |
A matrix applied to mashr fitting result, enabling comparisons for different conditions based on posteior distributions. |
See compute_posterior_matrices_common_cov_R
.
# The following example performs pairwise comparisons in a data set
# with 5 conditions: that is, it compares conditions (column) 1 and
# 2, 1 and 3, 1 and 4, 1 and 5, 2 and 3, etc.
library(Matrix)
set.seed(1)
simdata <- simple_sims(100,5,1)
dat <- mash_set_data(simdata$Bhat,simdata$Shat)
U <- cov_canonical(dat)
m <- mash(dat,U)
x <- combn(5,2)
n <- ncol(x)
contrast_mat <- as.matrix(sparseMatrix(i = rep(1:n,each = 2),
j = as.vector(x),
x = 1,dims = c(n,5)))
res <- get_posterior_condition_wise_summary(dat,m,contrast_mat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.