View source: R/1a-propr-backend.R
basis_shrinkage | R Documentation |
This function performs covariance shrinkage and calculates the partial correlation matrix based on the input count data matrix. The function can output the results in two formats: centered log-ratio (clr) or additive log-ratio (alr).
basis_shrinkage(M, outtype = c("clr", "alr"))
M |
A data matrix representing the counts. Each row should represent observations, and each column should represent different variables. |
outtype |
A character vector specifying the output type. It can take either "clr" (centered log-ratio) or "alr" (additive log-ratio). |
A matrix representing the partial correlation matrix.
# Sample input count data
data <- iris[,1:4]
# Calculate partial correlation matrix using clr transformation
result_clr <- basis_shrinkage(data, outtype = "clr")
# Calculate partial correlation matrix using alr transformation
result_alr <- basis_shrinkage(data, outtype = "alr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.