logistic_univariate: Univariate Logistic Regression

Description Usage Arguments Value

View source: R/logistic_regression.r

Description

A function used to generate multiple result table for univariate logistic regression model with y ~ x. For each specified y_names, a result table is computed, including all x_names variables.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
logistic_univariate(
  data,
  y_names,
  x_names,
  twobytwo = TRUE,
  formula = "(y ~ x)",
  collapse = FALSE,
  ref_label = "1",
  digits = 2
)

Arguments

data

A dataframe including all the variables needed in all the models

y_names

Vector. Name(s) of response variable(s)

x_names

Vector. Name(s) of predictor variable(s)

twobytwo

Logical. Either to include the two by two table for each variable. Default is TRUE.

formula

Formula for logistic regression to customize. Default is (y ~ x).

collapse

"NULL", "OR", "CI". Collapse columns in one column. "OR" collapses OR, Upper and Lower CI. "CI" collapses Upper and Lower CI.

ref_label

Character. Set the label for reference estimate.

digits

Numeric. Number of digits to display.

Value

The returned value is a list of length y_names, which consists of a dataframe having the univariate logistic regressions of the x_names.


CRUF documentation built on March 13, 2020, 1:34 a.m.