Learn R Programming

grpregOverlap (version 2.2-0)

incidenceMatrix: Compute the incidence matrix indicating group memebership

Description

Compute a p-by-J sparse matrix indicating which group(s) the variable(s) belong(s) to.

Usage

incidenceMatrix(X, group)

Arguments

X
The design matrix, without an intercept, as in grpregOverlap.
group
A list of vectors containing group information, as in grpregOverlap.

Value

A sparse p-by-J matrix as described above.

Details

This function is intended to provide an interface for users to construct the so-called incidence matrix, denoted as M, with dimension p-by-J, where p is the number of variables, and J is the number of groups. If variable i is contained by group j, then M[i, j] = 1; otherwise, M[i, j] = 0.

Note that since a variable can be contained by multiple groups, so the sum of row M[i, ] can be larger than 1.

See Also

grpregOverlap, overlapMatrix

Examples

Run this code
data(pathway.dat)
X <- pathway.dat$expression
group <- pathway.dat$pathways
incidence.mat <- incidenceMatrix(X, group)
dim(incidence.mat)

Run the code above in your browser using DataLab