Skip to contents

Creates a qdec matrix from a model formula.

Usage

qdec(data, formula)

Arguments

data

input data.frame

formula

a model formula or terms object. For simple qdec file, with binary columns for all levels of a factor, make sure to include a formula with -1 to remove the intercept.

Value

qdec with model matrix

Examples

cars <- mtcars
cars$cyl <- as.factor(cars$cyl)

qdec <- qdec(cars, mpg ~ cyl + hp)