extract_pi_quantiles {CNVRG}R Documentation

Extract quantiles of pi parameters

Description

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

Usage

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

#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))

[Package CNVRG version 1.0.0 Index]