createGroupsSim | R Documentation |
Create an object specifying groups of covariates as needed for some of the simulations.
createGroupsSim(G, p)
G |
Number of groups |
p |
Number of covariates |
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.
List containing the following components:
var2group
Integer vector of length p
, with entry
j
being the index of the group containing covariate j
group2var
List of length G
, each entry of which is an
integer vector containing the indices of the covariates belonging to that
group
sizes
Vector of length G
containing the number of
covariates in each group
Laurel Stell and Chiara Sabatti
Maintainer: Laurel Stell <lstell@stanford.edu>
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]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.