logit {mStats}R Documentation

Logistic Regression Model

Description

logit() produces summary of the model with coefficients or odds ratios (OR) and 95% Confident Intervals.

Usage

logit(model, or = TRUE, digits = 5)

Arguments

model

glm or lm model

or

TRUEreports odds ratios instead of coefficients

digits

specify rounding of numbers. See round.

Details

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

Outputs

Outputs can be divided into three parts.

  1. ⁠Info of 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.

  2. ⁠Regression Output⁠: Coefficients from summary of model are tabulated here along with 95\ confidence interval.

Value

a list containing

  1. info - info and error tables

  2. reg - regression table

  3. model - raw model output from lm()

  4. fit - formula for fitting the model

  5. lbl - variable labels for further processing in summary.

Author(s)

Email: dr.myominnoo@gmail.com

Website: https://myominnoo.github.io/

Examples


mylogit <- glm(case ~ education + age + parity, family = binomial,
           data = infert)
logit(mylogit)

## Not run: 
## Example from UCLA website:
## LOGIT REGRESSION | R DATA ANALYSIS EXAMPLES
## https://stats.idre.ucla.edu/r/dae/logit-regression/

mydata <- read.csv("https://stats.idre.ucla.edu/stat/data/binary.csv")
mydata <- replace(mydata, rank, factor(rank))
mydata <- label(mydata, gre = "GRE", gpa = "GPA score", rank = "Ranking")
mylogit <- glm(admit ~ gre + gpa + rank, data = mydata, family = "binomial")

## Showing Odds Ratios
logit(mylogit)

## Showing coefficients
logit(mylogit, or = FALSE)

## End(Not run)


[Package mStats version 3.4.0 Index]