collapse_pp_combin: Collapse posterior probabilities of association for...

Description Usage Arguments Value Examples

View source: R/processing.R

Description

Combine the posterior probabilities for combinations of individual traits/studies according to the association patterns from which those traits/studies all come from the alternative distribution. Provides the posterior probability of being associated with "at least traits X, Y and Z", for example. Can also require non-null association with one or more traits/studies and combine over patterns where that/those trait(s) also come from the alternative distribution.

Usage

1
collapse_pp_combin(post_prob, combos, req_idx = NULL, prefix = "pp")

Arguments

post_prob

matrix of posterior probabilities.

combos

matrix or integer specifying combinations. When matrix, each row is a combination, with column indices of traits belonging to the combination specified in columns of combos. When integer, all combinations of (total # traits) taking combos elements at a time will be tested.

req_idx

(optional) scalar or integer vector of trait(s) where a non-null association is required (i.e. from the alternative distribution). If NULL, no traits will be required.

prefix

character string denoting prefix of column names for the results matrix.

Value

A numeric matrix of combined posterior probabilities.

Examples

1
2
3
## all pairs of traits
myCombos <- t(combn(4,2))
collapsed_pp <- collapse_pp_combin(post_prob,myCombos)

kjgleason/primo documentation built on Sept. 7, 2021, 5:21 p.m.