correl_filter: Correlation filter

View source: R/filters.R

correl_filterR Documentation

Correlation filter

Description

Filter using correlation (Pearson or Spearman) for ranking variables.

Usage

correl_filter(
  y,
  x,
  force_vars = NULL,
  nfilter = NULL,
  p_cutoff = 0.05,
  method = "pearson",
  type = c("index", "names", "full"),
  ...
)

Arguments

y

Response vector

x

Matrix of predictors

force_vars

Vector of column names within x which are always retained in the model (i.e. not filtered). Default NULL means all predictors will be passed to filterFUN.

nfilter

Number of predictors to return. If NULL all predictors with p values < p_cutoff are returned.

p_cutoff

p value cut-off

method

Type of correlation, either "pearson" or "spearman".

type

Type of vector returned. Default "index" returns indices, "names" returns predictor names, "full" returns a matrix of p-values.

...

Further arguments passed to correls

Value

Integer vector of indices of filtered parameters (type = "index") or character vector of names (type = "names") of filtered parameters. If type is "full" full output from correls is returned.


nestedcv documentation built on Dec. 5, 2022, 5:25 p.m.