model_matrix: Construct Design Matrix

Description Usage Arguments Value Examples

View source: R/model_matrix.R

Description

Creates a design matrix by expanding factors to a set of dummy variables.

Usage

1
model_matrix(DT, ColNameFactor, other_class)

Arguments

DT

a data table contains the factors and the response.

ColNameFactor

a char vector with the name of the selected factor.

other_class

a char vector with the name of other classes than numeric (factor or char).

Value

return the value.

Examples

1
2
3
4
5
6
library(data.table)
data(example_data)
m = model_matrix (example_data,
colnames(example_data)[-c(1:3)],
other_class = colnames(example_data)[14:23])
print(m)

ZIprop documentation built on June 9, 2021, 5:09 p.m.