design_matrix: Create interactions and polynomials

View source: R/data_prep_utils.R

design_matrixR Documentation

Create interactions and polynomials

Description

This function takes a dataset and strings with variable names as input and creates interactions and polynomials

Usage

design_matrix(data, int = NULL, int_d = 2, poly = NULL, poly_d = 2, log = NULL)

Arguments

data

Matrix with the main variables.

int

Vector of strings with the variables to be interacted.

int_d

Degree of interactions created. Default is 2.

poly

Vector of strings with the variables for which polynomials should be created.

poly_d

Degree of polynomials to be created. Default is 2.

log

Vector of strings with the variables for which the logged versions should be added.

Value

Matrix including the main variables and the newly generated ones.#'


MCKnaus/causalDML documentation built on Aug. 19, 2023, 5:47 p.m.