% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/batch_kruskal.R
\name{batch_kruskal}
\alias{batch_kruskal}
\title{Batch Kruskal-Wallis Test}
\usage{
batch_kruskal(data, group, feature = NULL, feature_manipulation = FALSE)
}
\arguments{
\item{data}{Data frame containing the dataset for analysis.}

\item{group}{Character string specifying the name of the grouping variable.}

\item{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`.}

\item{feature_manipulation}{Logical indicating whether to apply feature
manipulation to filter valid features. Default is `FALSE`.}
}
\value{
Tibble containing:
\describe{
  \item{sig_names}{Feature name}
  \item{p.value}{Raw p-value from Kruskal-Wallis test}
  \item{statistic}{Test statistic (chi-squared)}
  \item{p.adj}{Adjusted p-value (Benjamini-Hochberg)}
  \item{log10pvalue}{Negative log10-transformed p-value}
  \item{stars}{Significance stars: **** p<0.0001, *** p<0.001,
    ** p<0.01, * p<0.05, + p<0.5}
  \item{group columns}{Mean-centered values for each group}
}
}
\description{
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.
}
\examples{
# Load TCGA-STAD signature data
sig_stad <- load_data("sig_stad")

# Test features by gender (if available in your dataset)
if ("Gender" \%in\% colnames(sig_stad)) {
  res <- batch_kruskal(
    data = sig_stad,
    group = "Gender",
    feature = colnames(sig_stad)[69:ncol(sig_stad)]
  )
  head(res)
}
}
\author{
Dongqiang Zeng
}
