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:

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

Author(s)

Laurel Stell and Chiara Sabatti
Maintainer: Laurel Stell <lstell@stanford.edu>

See Also

createData

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]