getBestVar {folda} | R Documentation |
Select Best Variable at Current Step Based on Multivariate Test Statistics
Description
This function selects the best variable based on the specified multivariate
test statistic (Pillai
or Wilks
). It evaluates the statistic for each
candidate variable in newVar
when combined with currentVar
, and returns
the index and test statistic of the best variable. It also identifies
collinear variables.
Usage
getBestVar(currentVar, newVar, Sw, St, testStat = "Pillai")
Arguments
currentVar |
A numeric vector indicating the indices of currently selected variables. |
newVar |
A numeric vector indicating the indices of candidate variables to be tested. |
Sw |
A matrix representing the within-class scatter matrix. |
St |
A matrix representing the total scatter matrix. |
testStat |
A character string specifying the test statistic to use. Can
be either |
Value
A list containing:
stopflag |
A logical value indicating whether the best variable is collinear (i.e., should the selection stop). |
varIdx |
The index of the selected variable from |
stat |
The value of the test statistic for the selected variable. |
collinearVar |
A vector of indices from |