my.dummy.df: Create a Design Matrix with the Desired Constrasts

Description Usage Arguments Details Value Author(s) Examples

View source: R/my.dummy.df.R

Description

This function generates a dummy variable data frame in support various functions.

Usage

1
my.dummy.df(data, contr = "contr.niets")

Arguments

data

a data frame

contr

an optional list. See the contrasts.arg of model.matrix.default.

Details

my.dummy.df takes a data.frame with categorical variables, and returns a data.frame in which all the categorical variables columns are expanded as dummy variables.

The argument contr is passed to the default contr.niets; contr.helmert, contr.poly, contr.sum, contr.treatment are also supported.

Value

For datasets with categorical variables it produces the specified design matrix.

Author(s)

Nelson Lee Afanador (nelson.afanador@mvdalab.com)

Examples

1
2

mvdalab documentation built on May 30, 2017, 2:40 a.m.