getUDummyMatForOneVec {aglm}R Documentation

Create a U-dummy matrix for one variable

Description

Create a U-dummy matrix for one variable

Usage

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


[Package aglm version 0.4.0 Index]