full.model.mtx {cmenet} | R Documentation |
Generate full model matrix for MEs and CMEs
Description
full.model.mtx
returns the full model matrix for main effects (MEs) and conditional main effects (CMEs).
Usage
full.model.mtx(xme)
Arguments
xme |
An |
Value
model.mtx |
An |
cme.mtx |
An |
Examples
library(MASS)
n <- 50 #number of observations
p <- 50 #number of main effects
## Simulate model matrix for MEs and CMEs
set.seed(1)
rho <- 0 #correlation
ones <- matrix(1,p,p)
covmtx <- rho*ones+(1-rho)*diag(p)
latmtx <- mvrnorm(n,p,mu=rep(0,p),Sigma=covmtx) #equicorrelated cov. matrix
memtx <- (latmtx>=0)-(latmtx<0) #simulate model matrix for MEs
model.mtx <- full.model.mtx(memtx)$model.mtx #generate model matrix for MEs and CMEs
[Package cmenet version 0.1.2 Index]