reglog | R Documentation |
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.
reglog( DF, y, explicatives = colnames(DF)[colnames(DF) != y], alpha = 0.05, dataprep = TRUE, verbose = TRUE, alpha_max = 0.2, round = 3, rowstimevariable = 10, keep = FALSE, exit = "html", stability = FALSE, equation = FALSE )
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. |
dataprep |
logical : whether performing datapreparation |
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. |
rowstimevariable |
: number of row per variable |
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) |
stability |
logical : wheter to perform the stability analysis |
equation |
logical : to show the equation of the regression function |
reglog returns a matrix with all OR obtain from univariate model and OR obtain from the multivariate model
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.