reglog: Logistic Regression Function

Description Usage Arguments Value References

View source: R/reglog.R

Description

reglog is able to perform logistic regression with variable selection and gives as a result a matrix with variable names, odds-ratios, confidence intervals and p-values of univariate and multivariate models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
reglog(
  DF,
  y,
  explicatives = colnames(DF)[colnames(DF) != y],
  alpha = 0.05,
  dataprep = TRUE,
  verbose = TRUE,
  alpha_max = 0.2,
  round = 3,
  rowstimevariable = 10,
  confirmation = FALSE,
  keep = FALSE,
  exit = "html",
  stability = FALSE,
  equation = FALSE,
  title = TRUE,
  ...
)

Arguments

DF

dataframe, matrix or tibble that contains all explicatives variables and the variable to explain

y

character : name of the variable to explain

explicatives

character vector : variables that should explain y in the logistic regression. Takes all columns but y from the dataframe if kept empty.

alpha

num : significance threeshold used to delete non-significant variables in the multivariate model.

verbose

logical : if TRUE, explainations are displayed in the console while running the function.

alpha_max

num : maximum threeshold used to select the minimum multivariate variables wanted.

round

num : number of digits to display in the final table.

keep

all the variables that should be kept in the multivariate results

exit

specify where do you want to display the results : console (the default), excel (in a results.xlsx file), html (using kable)

method

the method that will be used to select variables in the multivariate model.The default method is the backward elimination. See 'details' section for more informations.

Value

reglog returns a matrix with all OR obtain from univariate model and OR obtain from the multivariate model

References

Bursac, Z., Gauss, C.H., Williams, D.K. et al. Purposeful selection of variables in logistic regression. Source Code Biol Med 3, 17 (2008). https://doi.org/10.1186/1751-0473-3-17

Heinze G, Schemper M. A solution to the problem of separation in logistic regression. Stat Med. 2002;21(16):2409-2419. doi:10.1002/sim.1047


TanguyPerennec/Autostats documentation built on Dec. 13, 2020, 10:43 a.m.