This function performs forward selection on a dataset based on multivariate
test statistics (Pillai or Wilks). It iteratively adds variables that
contribute the most to the test statistic until no significant variables are
found or a stopping criterion is met.
forwardSel(m, response, testStat = "Pillai", alpha = 0.1, correction = TRUE)A list with three components:
A vector of selected variable indices based on the forward selection process.
A data frame containing detailed information about the forward selection process, including the selected variables, test statistics, and thresholds.
A character string describing why the selection process stopped.
A numeric matrix containing the predictor variables. Rows represent observations and columns represent variables.
A factor representing the response variable with multiple levels (groups).
A character string specifying the test statistic to use. Can
be "Pillai" (default) or "Wilks".
A numeric value between 0 and 1 specifying the significance level for the test. Default is 0.1.
A logical value indicating whether to apply a multiple
comparison correction. Default is TRUE.
Wang, S. (2024). A New Forward Discriminant Analysis Framework Based On Pillai's Trace and ULDA. arXiv preprint arXiv:2409.03136. Available at https://arxiv.org/abs/2409.03136.