| batch_cor | R Documentation |
Performs correlation analysis between a target variable and multiple feature variables. Computes correlation coefficients, p-values, and adjusts for multiple testing using the Benjamini-Hochberg method.
batch_cor(data, target, feature, method = c("spearman", "pearson", "kendall"))
data |
Data frame containing the target and feature variables. |
target |
Character string specifying the name of the target variable. |
feature |
Character vector specifying the names of feature variables to correlate with the target. |
method |
Character string specifying the correlation method. Options are '"spearman"', '"pearson"', or '"kendall"'. Default is '"spearman"'. |
Tibble containing the following columns for each feature:
Feature name
Raw p-value
Correlation coefficient
Adjusted p-value (Benjamini-Hochberg)
Negative log10-transformed p-value
Significance stars: **** p<0.0001, *** p<0.001, ** p<0.01, * p<0.05, + p<0.5
Dongqiang Zeng
# Create a small example dataset
set.seed(123)
data_df <- as.data.frame(matrix(runif(100 * 10), 100, 10))
colnames(data_df) <- paste0("Signature", 1:10)
# Perform batch correlation
results <- batch_cor(
data = data_df,
target = "Signature1",
feature = colnames(data_df)[2:10]
)
head(results)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.