get_design_mat: Create design matrix

View source: R/model_selection.R

get_design_matR Documentation

Create design matrix

Description

Format data table to produce a design matrix.

Usage

get_design_mat(
  data,
  var_names = NULL,
  corr_cutoff = 0.75,
  corr_method = c("spearman", "pearson"),
  check_binary_vars = T,
  strings_as_factors = T
)

Arguments

data

A data frame of potential explanatory variables for the design matrix. Rows should be records and columns should be variables.

var_names

A vector of column names from data to consider for the design matrix.

corr_cutoff

A numeric value in 0,1 denoting the absolute correlation cutoff to classify pairs of collinear variables.

corr_method

A string indicating the type of correlation to use for determining collinearity. Must be pearson or spearman.

check_binary_vars

A boolean indiciating if dichotomous variables should be included in the collinearity pruning.

strings_as_factors

A boolean indiciating if character variables should be converted to factors in the returned data frame.

Details

Creates a design matrix and prunes variables with no variance. Removes pairwise collinear variables.

Value

A data frame of explanatory variables for regression.

See Also

get_residual_matrix


bryancquach/omixjutsu documentation built on Jan. 29, 2023, 3:47 p.m.