covmat: construct covariate matrix (predictor matrix) in the right...

Description Usage Arguments Value Examples

View source: R/covmat.R

Description

construct covariate matrix (predictor matrix) in the right format for input to the mimi or cv.mimi functions from tables of attributes about the rows or columns of data frames.

Usage

1
covmat(n, p, R = NULL, C = NULL, E = NULL, center = T)

Arguments

n

number of rows

p

number ofcolumns

R

nxK1 matrix of row covariates

C

nxK2 matrix of column covariates

E

(n+p)xK3 matrix of row-column covariates

center

boolean indicating whether the returned covariate matrix should be centered (for identifiability)

Value

the joint product of R and C column-binded with E, a (np)x(K1+K2+K3) matrix in order row1col1,row2col1,...,rowncol1, row1col2, row2col2,...,rowncolp

Examples

1
2
3
R <- matrix(rnorm(10), 5)
C <- matrix(rnorm(9), 3)
covs <- covmat(5,3,R,C)

genevievelrobin/mimi documentation built on May 7, 2019, 10:57 a.m.