dvar: Diversifies the variables of a dataframe by testing...

View source: R/dvar.R

dvarR Documentation

Diversifies the variables of a dataframe by testing interactions, polynomials, logs... so that evolreg can draw a larger number of model combinations.

Description

Diversifies the variables of a dataframe by testing interactions, polynomials, logs... so that evolreg can draw a larger number of model combinations.

Usage

dvar(
  data,
  Y,
  X = c(),
  alpha = 0.05,
  family = "lm",
  wash = TRUE,
  NAfreq = 1,
  interaction = TRUE,
  multix = TRUE,
  multidiv = FALSE,
  verbose = FALSE
)

Arguments

data

a dataframe.

Y

the y to predict.

X

variables whose presence we want to force in the model.

alpha

0 to 1. If there are too many variables and the argument wash=TRUE, use this p-value threshold to eliminate the variables whose effect is too insignificant (Risk of eliminating the variables that will have an effect once transformed or in interaction).

family

"lm", "logical" or "lmer". Type of regression

wash

TRUE or FALSE.To select the best variables when there are too many.

NAfreq

from 0 to 1. NA part allowed in the variables. 1 by default (100% of NA tolerate).

interaction

FALSE or TRUE. To allow interactions between variables.

multix

FALSE or TRUE. To allow variable variants (log, exp, polynomial, ^2).

multidiv

FALSE or TRUE. To allow the synthesis of variables combining the ratio of one variable divided by another.

verbose

With an operating report.

Value

The dataframe of the data and a list of interaction formulas and transformations with associated p-values in their ability to predict Y.

Examples

data(iris)
dvar(iris,"Sepal.Length")

Antoine-Masse/KefiR documentation built on Feb. 22, 2024, 5:54 a.m.