| 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 |
|
digits |
specify rounding of numbers. See |
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.
-
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. -
Regression Output: Coefficients from summary of model are tabulated here along with 95\ confidence interval.
Value
a list containing
-
info- info and error tables -
reg- regression table -
model- raw model output fromlm() -
fit- formula for fitting the model -
lbl- variable labels for further processing insummary.
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)