powered by
Create an object specifying groups of covariates as needed for some of the simulations.
createGroupsSim(G, p)
List containing the following components:
var2group
Integer vector of length p, with entry \(j\) being the index of the group containing covariate \(j\)
p
group2var
List of length G, each entry of which is an integer vector containing the indices of the covariates belonging to that group
G
sizes
Vector of length G containing the number of covariates in each group
Number of groups
Number of covariates
Laurel Stell and Chiara Sabatti Maintainer: Laurel Stell <lstell@stanford.edu>
If G divides p, then each group will have p/G consecutive covariates. If G does not divide p, then the last group will have fewer covariates.
p/G
createData
grp <- createGroupsSim(G=3, p=15) # Which covariates are in group 2? Two ways to find out: which(grp$var2group == 2) grp$group2var[[2]]
Run the code above in your browser using DataLab