getUDummyMatForOneVec: Create a U-dummy matrix for one variable

Description Usage Arguments Value Author(s)

View source: R/get-dummies.R

Description

Create a U-dummy matrix for one variable

Usage

1
2
3
4
5
6
getUDummyMatForOneVec(
  x_vec,
  levels = NULL,
  drop_last = TRUE,
  only_info = FALSE
)

Arguments

x_vec

A vector representing original variable. The class of x_vec should be one of integer, character, or factor.

levels

A character vector representing values of x_vec used to create U-dummies. If NULL, all the unique values of x_vec are used to create dummies.

drop_last

If TRUE, the last column of the resulting matrix is dropped to avoid multicollinearity.

only_info

If TRUE, only information fields of returned values are filled and no dummy matrix is returned.

Value

A list with the following fields:

Author(s)

Kenji Kondo


aglm documentation built on June 9, 2021, 5:08 p.m.