Learn R Programming

MVar (version 2.0.4)

IM: Indicator matrix.

Description

In the indicator matrix the elements are arranged in the form of dummy variables, in other words, 1 for a category chosen as a response variable and 0 for the other categories of the same variable.

Usage

IM(Data, Names = TRUE)

Arguments

Data

Categorical data.

Names

Include the names of the variables in the levels of the Indicator Matrix (default = TRUE).

Value

Dados

Returns converted data in the indicator matrix.

References

RENCHER, A. C. Methods of Multivariate Analysis. 2th. ed. New York: J.Wiley, 2002. 708 p.

Examples

Run this code
# NOT RUN {
Data <- matrix(c("S","S","N","N",1,2,3,4,"N","S","T","N"), nrow = 4, ncol = 3)

IM(Data, Names = FALSE)

data(DataQuali) # qualitative data set

IM(DataQuali, Names = TRUE)
# }

Run the code above in your browser using DataLab