Learn R Programming

mStats (version 3.2.2)

logistic: Logistic Regression Models

Description

logistic() produces regression outputs which mirror outputs from STATA.

Usage

logistic(data, y, ..., odds_ratio = TRUE, rnd = 3)

Arguments

data

Dataset

y

Dependent variable

...

Independent variable or multiple variables

odds_ratio

if TRUE, odds ratios, exponentiated coefficients are calculated. Otherwise, coefficients are estimated.

rnd

specify rounding of numbers. See round.

Value

A list of two data.frame and model

Details

logistic is based on glm with binomial family. All statistics presented in the function's output are derivates of glm, except AIC value which is obtained from AIC.

Outputs

Outputs can be divided into three parts.

  1. Information about the model

Here provides number of observations (Obs.), chi value from Likelihood Ratio test (LR chi2) and its degree of freedom, p-value from LR test, Pseudo R Squared, log likelihood and AIC values.

  1. Regression Output

Coefficients from summary of model are tabulated here along with 95\ confidence interval.

Examples

Run this code
# NOT RUN {
## use infert data
data(infert)

## run logistic regression
logistic(infert, case, induced, spontaneous)

## get coefficient instead of odds ratio
logistic(infert, case, induced, spontaneous, odds_ratio = FALSE)

# }

Run the code above in your browser using DataLab