View source: R/functions_create.R
createZforGroupset | R Documentation |
Create a co-data matrix Z for a group set as obtained for instance with createGroupset.
createZforGroupset(groupset,p=NULL)
groupset |
A list with G elements that contain the indices of the variables belonging to each of the groups. |
p |
Number of covariates in total. If not given, taken as maximum index in ‘groupset’. But in cases where some covariates are left unpenalised, the total number of covariates may be larger. |
A (pxG)-dimensional co-data matrix.
createGroupset
#Group set: G random groups G <- 5 #number of groups p <- 300 #number of covariates from which last 10 left unpenalised #sample random categorical co-data: categoricalRandom <- as.factor(sample(1:G,(p-10),TRUE)) #make group set, i.e. list with G groups groupsetRandom <- createGroupset(categoricalRandom) Zcat <- createZforGroupset(groupsetRandom,p=p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.