makeDummy: makeDummy

Description Usage Arguments Value Author(s) Examples

View source: R/makeDummy.R

Description

This function is to make dummy variables using a discrete variable.

Usage

1

Arguments

tZ

An input vector

Value

Returns dZ, a matrix of size length(tZ)-by-card(tZ) :

The ij-th element in dZ is 1 if tZ[i] is equal to the j-th largest value of tZ. And the ij-th element in DZ is 0 otherwise. The row sum of dZ must be 1 by construction.

Author(s)

Yujung Hwang, yujungghwang@gmail.com

Examples

1
makeDummy(c(1,2,3))

factormodel documentation built on June 4, 2021, 9:07 a.m.