model.matrix.data.frame: Get Design Matrix

Description Usage Arguments Value

View source: R/model_matrix_data_frame.R

Description

An S3 function to return a design matrix given a data.frame and a linear regression formula

Usage

1
2
## S3 method for class 'data.frame'
model.matrix(X, factor_indep_vars, add_intercept)

Arguments

X

a data.frame

factor_indep_vars

a vector of names of independent variables whose classes are of factor type

add_intercept

a boolean; TRUE requires the design matrix to include a column for an intercept

Value

the design matrix


dsn00b/linear_regression documentation built on Nov. 9, 2021, 11:39 p.m.