Learn R Programming

MultBiplotR (version 23.11.0)

DataFrame2Matrix4Regression: Prepares a matrix for regression from a data frame

Description

Prepares a matrix for regression from a data frame

Usage

DataFrame2Matrix4Regression(X, last = TRUE, Intercept = FALSE)

Value

A matrix ready to use as independent variables in a regression

Arguments

X

A data frame

last

Logical to use the last category of nominal variabless as baseline.

Intercept

Logical to tell the function if a constant must be present

Author

Jose Luis Vicente Vilardon

Details

Nominal variables are converted to a matrix of dummy variables for regression.

Examples

Run this code
##---- Should be DIRECTLY executable !! ----

Run the code above in your browser using DataLab