extract_pi_quantiles: Extract quantiles of pi parameters

Description Usage Arguments Value Examples

View source: R/convrg_func.R

Description

Provides quantiles of pi parameters for each feature and treatment group.

Usage

1
extract_pi_quantiles(model_out, probs = c(0.05, 0.5, 0.95))

Arguments

model_out

Output of CNVRG modeling functions, including cnvrg_HMC and cnvrg_VI

probs

A vector of quantiles

Value

A list specifying quantiles for each feature in each treatment group.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
#simulate an OTU table
com_demo <-matrix(0, nrow = 10, ncol = 10)
com_demo[1:5,] <- c(rep(3,5), rep(7,5)) #Alternates 3 and 7
com_demo[6:10,] <- c(rep(7,5), rep(3,5)) #Reverses alternation
fornames <- NA
for(i in 1:length(com_demo[1,])){
fornames[i] <- paste("otu_", i, sep = "")
}
sample_vec <- NA
for(i in 1:length(com_demo[,1])){
sample_vec[i] <- paste("sample", i, sep = "_")
}
com_demo <- data.frame(sample_vec, com_demo)
names(com_demo) <- c("sample", fornames)

out <- cnvrg_VI(com_demo,starts = c(1,6), ends=c(5,10))
extract_pi_quantiles(model_out = out, probs = c(0.05,0.5,0.95))

JHarrisonEcoEvo/CNVRG documentation built on Dec. 30, 2021, 1:21 a.m.