Conduct a logistic regression analysis
logistic_regression(
data = NULL,
formula = NULL,
formula_1 = NULL,
formula_2 = NULL,
z_values_keep = FALSE,
constant_row_clean = TRUE,
odds_ratio_cols_combine = TRUE,
round_b_and_se = 3,
round_z = 3,
round_p = 3,
round_odds_ratio = 3,
round_r_sq = 3,
round_model_chi_sq = 3,
pretty_round_p_value = TRUE,
print_glm_default_summary = FALSE,
print_summary_dt_list = TRUE,
print_model_comparison = TRUE,
output_type = "summary_dt_list"
)
the output will be a summary of logistic regression results,
unless set otherwise by the output_type
argument to the function.
a data object (a data frame or a data.table)
formula for estimating a single logistic regression model
formula for estimating logistic regression model 1 of 2
formula for estimating logistic regression model 2 of 2
logical. Should the z values be kept in the table? (default = FALSE)
logical. Should the row for the constant be cleared except for b and standard error of b? (default = TRUE)
logical. Should the odds ratio columns be combined? (default = TRUE)
number of decimal places to which to round b and standard error of b (default = 3)
number of decimal places to which to round z values (default = 3)
number of decimal places to which to round p-values (default = 3)
number of decimal places to which to round odds ratios (default = 3)
number of decimal places to which to round R-squared values (default = 3)
number of decimal places to which to round model chi-squared values (default = 3)
logical. Should the p-values be rounded
in a pretty format (i.e., lower threshold: "<.001").
By default, pretty_round_p_value = TRUE
.
logical. Should the default summary output of the glm objects be printed? (default = FALSE)
logical. Should the summaries of logistic regressions in a data table format be printed? (default = TRUE)
logical. Should the comparison of two logistic regression models be printed? (default = TRUE)
If output_type = "summary_dt_list"
(default),
the output of the function will be summaries of the two logistic
regressions in a data.table format.
If output_type = "glm_object_list"
, the output of the
function will be the two glm
objects estimating logistic
regression models. If output_type = "glm_default_summary_list"
,
the output of the function will be the R's default summary
output for the two glm
objects estimating logistic
regression models. If output_type = "model_comparison_stats"
,
the output of the function will be statistics from comparison of the
two logistic regression models. If output_type = "all"
,
the output of the function will be a list of the aforementioned outputs.
logistic_regression(data = mtcars, formula = am ~ mpg)
logistic_regression(
data = mtcars,
formula_1 = am ~ mpg,
formula_2 = am ~ mpg + wt)
Run the code above in your browser using DataLab