A new formulation of principal component analysis (PCA) that considers group structure in the data is proposed as a Variable Subset Selection (VSS) method. Optimization of electrode channels is a key problem in brain-computer interfaces (BCI). BCI experiments generate large feature spaces compared to the sample size due to time limitations in EEG sessions. It is essential to understand the importance of the features in terms of physical electrode channels in order to design a high performance yet realistic BCI. The VSS produces a ranked list of original variables (electrode channels or features), according to their ability to discriminate between tasks. A linear discrimination analysis (LDA) classifier is applied to the selected variable subset, Evaluation of the VSS method using synthetic datasets selected more than 83% of relevant variables. Classification of imagery tasks using real BCI datasets resulted in less than 16% classification error.