evolreg: Identify the best linear, logistic or mixed regression model...

View source: R/evolreg.R

evolregR Documentation

Identify the best linear, logistic or mixed regression model using an evolutionary approach.

Description

Identify the best linear, logistic or mixed regression model using an evolutionary approach.

Usage

evolreg(
  data,
  Y,
  X = c(),
  alpha = 0.05,
  nvar = 0,
  iter = 4000,
  multix = TRUE,
  interaction = TRUE,
  multidiv = TRUE,
  nbind = c(),
  wash = TRUE,
  NAfreq = 1,
  family = "lm",
  plot = FALSE,
  verbose = TRUE,
  fast = TRUE
)

Arguments

data

a dataframe.

Y

the y to predict.

X

vector of 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).

nvar

Maximum number of variables in the model. A default value is proposed according to the number of individuals.

iter

Number of iterations.

multix

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

interaction

FALSE or TRUE. To allow interactions between variables.

multidiv

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

nbind

Number of simulated individuals in the population of models to be crossed in an evolutionary approach. A default value is proposed according to the number of variables.

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).

family

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

plot

To visualize the evolution of the R2 of the models obtained after each crossing.

verbose

To display a summary of the intermediate models.

fast

Paramètre qui stoppe les itérations lorsque le R carré des modèles n'évolue plus de façon significative.

Value

A strongest possible regression model chosen from the available variables.

Examples

data(mtcars)
evolreg(mtcars,"mpg",plot=TRUE)

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