Basic usage of the R package grpSLOPE
Introduction
Group SLOPE (gSLOPE) is a penalized linear regression method that is used for adaptive selection of groups of significant predictors in a highdimensional linear model. A unique property of the Group SLOPE method is that it offers group false discovery rate (gFDR) control (i.e., control of the expected proportion of irrelevant groups among the total number of groups selected by Group SLOPE). A detailed description of the method can be found in D. Brzyski, A. Gossmann, W. Su, and M. Bogdan (2019) “Group SLOPE — adaptive selection of groups of predictors” Journal of the American Statistical Association (or the 2016 arXiv preprint).
Group SLOPE is implemented in the R package grpSLOPE
. As an introduction to the R package, in the following we will walk through a basic usage demonstration. First, we will simulate some data, before we feed it into grpSLOPE
, and subsequently examine the output.
Data generation
We simulate a $500 \times 500$ SNPdatalike model matrix.
For example, the upper left $10 \times 10$ corner of $X$ looks as follows.
1 1 0 1 0 0 1 2 0 0
0 0 1 1 0 0 1 1 1 0
1 0 1 1 0 0 1 0 0 0
1 0 0 0 1 0 0 0 2 2
1 0 0 1 1 1 0 0 1 1
0 1 0 0 0 0 2 1 2 2
0 0 0 0 1 2 0 0 2 0
2 0 0 0 0 0 0 1 0 2
1 0 1 0 0 1 0 1 1 1
0 0 1 0 0 0 0 0 1 1
Note: In fact, with the default settings, the Group SLOPE method is guaranteed to control gFDR only when applied to a data matrix, where the columns corresponding to different groups of predictors are nearly uncorrelated. The relevant theoretical results can be found in Brzyski et. al. (2016). Only for the brevity of exposition we neither check for nor enforce low betweengroup correlations in this example.
We divide the 500 predictor variables into 100 groups of sizes ranging from 3 to 7.
For further usage we keep additional information about the grouping structure of predictors, such as the total number of groups and the group sizes.
In order to simulate a response variable, we randomly select 10 groups to be truly significant.
The randomly selected truly significant groups are:
grp4 grp13 grp22 grp34 grp35 grp59 grp65 grp68 grp72 grp78
Then we generate the vector of regression coefficients, by sampling effect sizes for the significant groups from the Uniform(0,1) distribution.
Finally, we generate the response vector according to a linear model with i.i.d. $\mathcal{N}(0, 1)$ noise terms.
Fitting the Group SLOPE model
We fit the Group SLOPE model to the simulated data. The function argument fdr
signifies the target groupwise false discovery rate (gFDR) of the variable selection procedure.
Model fit results
The resulting object model
of class “grpSLOPE” contains a lot of information about the resulting Group SLOPE model. Some of these parameters are shown below.
 Groups that were selected as significant by the Group SLOPE method.
Notice that the model has correctly identified all significant groups, and additionally has falsely reported the group “grp11” as significant.
 The estimated noise level $\hat{\sigma}$ (true $\sigma$ is equal to one).
 The regression coefficients, which can be displayed either on the normalized scale (i.e., the scale corresponding to the normalized versions of $X$ and $y$, on which all the parameter estimates are computed internally),
or on the original scale of $X$ and $y$,
(notice that the coefficients are named corresponding to the given grouping structure). As expected from a penalized regression method, we observe some shrinkage, when we compare the above to the true parameters.
 It might also be interesting to plot the first few elements of the regularizing sequence $\lambda$ used by the Group SLOPE method for the given inputs.
We can further check the performance of the method by computing the resulting group false discovery proportion (gFDP) and power.
[1] “gFDP = 0.0909090909090909”
[1] “Power = 1”
We see that the method indeed did not exceed the target gFDR, while maintaining a high power.
Lambda sequences
Multiple ways to select the regularizing sequence $\lambda$ are available.
If a group structure with little correlation between groups can be assumed (i.e., groups in the standardized model matrix are nearly orthogonal), then we suggest to use the sequence “corrected”, which is the default.
The $\lambda$ sequences “mean” and “max” can be used together with the options orthogonalize = FALSE
and normalize = FALSE
, when the columns of the model matrix are exactly orthogonal to each other (“max” is more conservative, giving exact gFDR control only when all groups have the same size, and otherwise resulting in a lower gFDR than the target level).
Alternatively, any nonincreasing sequence of appropriate length can be utilized. However, we do not recommend to use any other $\lambda$ sequences unless you really know what you are doing.
References

Bogdan, M., van den Berg, E., Sabatti, C., Su, W., and Candès, E. J. (2015), SLOPE — Adaptive Variable Selection via Convex Optimization. The Annals of Applied Statistics, vol. 9, no. 3, p. 1103.

D. Brzyski, A. Gossmann, W. Su, and M. Bogdan (2019) Group SLOPE — adaptive selection of groups of predictors. Journal of the American Statistical Association 114 (525): 419–33.

Gossmann, A., Cao, S., and Wang, Y.P. (2015). Identification of Significant Genetic Variants via SLOPE, and Its Extension to Group SLOPE. In Proceedings of the 6th ACM Conference on Bioinformatics, Computational Biology and Health Informatics, BCB ’15 (pp. 232–240). New York, NY, USA: ACM.