| createGroupsSim {ptycho} | R Documentation |
Create Groups of Covariates
Description
Create an object specifying groups of covariates as needed for some of the simulations.
Usage
createGroupsSim(G, p)
Arguments
G |
Number of groups |
p |
Number of covariates |
Details
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.
Value
List containing the following components:
var2groupInteger vector of length
p, with entryjbeing the index of the group containing covariatejgroup2varList of length
G, each entry of which is an integer vector containing the indices of the covariates belonging to that groupsizesVector of length
Gcontaining the number of covariates in each group
Author(s)
Laurel Stell and Chiara Sabatti
Maintainer: Laurel Stell <lstell@stanford.edu>
See Also
Examples
grp <- createGroupsSim(G=3, p=15)
# Which covariates are in group 2? Two ways to find out:
which(grp$var2group == 2)
grp$group2var[[2]]
[Package ptycho version 1.1-4 Index]