View source: R/batch_kruskal.R
| batch_kruskal | R Documentation |
Performs Kruskal-Wallis rank sum tests on multiple continuous features across different groups. Computes p-values, adjusts for multiple testing, and ranks features by significance.
batch_kruskal(data, group, feature = NULL, feature_manipulation = FALSE)
data |
Data frame containing the dataset for analysis. |
group |
Character string specifying the name of the grouping variable. |
feature |
Character vector specifying the names of feature variables to test. If 'NULL', the user is prompted to select features (interactive mode only). Default is 'NULL'. |
feature_manipulation |
Logical indicating whether to apply feature manipulation to filter valid features. Default is 'FALSE'. |
Tibble containing:
Feature name
Raw p-value from Kruskal-Wallis test
Test statistic (chi-squared)
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
Mean-centered values for each group
Dongqiang Zeng
# Create small example data
set.seed(123)
test_data <- data.frame(
Gender = rep(c("Male", "Female"), each = 50),
Signature1 = rnorm(100),
Signature2 = rnorm(100)
)
# Test features by gender
res <- batch_kruskal(
data = test_data,
group = "Gender",
feature = c("Signature1", "Signature2")
)
head(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.