View source: R/1a-propr-backend.R
pcor.bshrink | R Documentation |
This function performs covariance shrinkage on the basis matrix and calculates the partial correlation matrix. The function can output the results in two formats: centered log-ratio (clr) or additive log-ratio (alr).
pcor.bshrink(ct, outtype = c("clr", "alr"))
ct |
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). Since the reference does not affect the logratio partial correlation coefficients, the index of the reference is not needed for "alr". Also, "clr" is recommended because of the same reason, at the same time avoiding losing one dimension. |
A matrix representing the shrunk partial correlation matrix.
# Sample input count data
data <- iris[,1:4]
# Calculate partial correlation matrix using clr transformation
result_clr <- pcor.bshrink(data, outtype = "clr")
# Calculate partial correlation matrix using alr transformation
result_alr <- pcor.bshrink(data, outtype = "alr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.