info.glm.Rd
Summarize a logistic regression model of class "glm"
.
# S3 method for glm
info(x)
an object of class "glm"
A list of class c("info.glm"
, "list"
).
overall
omnibus.test
fit.indices
anova.table
coefficient.table
odds.ratios
The function info.glm
produces a summary for a
logistic regression model fitted with the glm
or
regress
function. There are six sections.
Model formula, data frame, and sample size (N), and predicted category.
Chi-square statistic, degrees of freedom, p-value.
Stukel's GOF Test, Tjur's psuedo R squared, and Akaike's information criterion (AIC).
ANOVA table with type III (marginal) effects.
Regression coefficients (B), standard errors (SE), z-values, and p-values.
odds ratios with 95% confidence intervals
The ANOVA table is obtained from the Anova
function in
the car
package. Odds ratios and confidence intervals are obtained
from the Confint
function from the car
package.
Tjur's pseudo-R.squared (2009) is defined as the mean absolute difference between the mean predicted probability for the positive group and the mean predicted probability for the negative group. It ranges from zero to one.
Stukel provides a goodness of fit (GOF) fit test for ungrouped data, and has better properties than the traditional Hosmer-Lemeshow test in simulation studies. A significant result suggests model misspecification. See Allison (2014) for details.
Allison, P. D. (2014). "Measures of fit for logistic regression", SAS Global Forum https://statisticalhorizons.com/wp-content/uploads/GOFForLogisticRegression-Paper.pdf
Allison, P. D. (2014). "Another goodness-of-fit test for logistic regression". https://statisticalhorizons.com/another-goodness-of-fit-test-for-logistic-regression
Stukel, T. A. (1988). “Generalized Logistic Models.” Journal of the American Statistical Association 83:426–431.
Tjur, T. (2009) “Coefficients of determination in logistic regression models—A new proposal: The coefficient of discrimination.” The American Statistician 63: 366-372.
fit <- glm(caesarian ~ age + bp + delivery.time, family = binomial, data = caesarian)
info(fit)
#> LOGISTIC REGRESSION SUMMARY
#> Formula: caesarian ~ age + bp + delivery.time
#> Data : caesarian
#> N : 80
#>
#> Predicted category: yes
#>
#> Omnibus Test
#> Chi-square(5) = 15.2455, p = 0.009363 **
#>
#> Fit Measures
#> Stukel's GOF Test: Chi-square(2) = 0.0663, p < 0.9674
#> Tjur's Psuedo-R.squared: 0.1769
#> AIC: 105.8512
#>
#> Anova Table (type III tests)
#> LR Chisq DF Pr(>Chisq)
#> age 0.6465 1 0.421353
#> bp 12.1255 2 0.002328 **
#> delivery.time 6.9476 2 0.030999 *
#>
#> Logistic Regression Coefficients
#> B SE z Pr(>|z|)
#> (Intercept) 1.02083 1.49393 0.6833 0.494407
#> age 0.03944 0.04928 0.8003 0.423531
#> bpnormal -2.05065 0.71483 -2.8687 0.004122 **
#> bphigh -0.46110 0.75158 -0.6135 0.539542
#> delivery.timepremature -1.29707 0.67785 -1.9135 0.055685
#> delivery.timelatecomer -1.53961 0.70396 -2.1871 0.028737 *
#>
#> Odds Ratios (with 95% Confidence Intervals)
#> Odds Ratio 2.5% 97.5%
#> age 1.0402 0.94482 1.1489
#> bpnormal 0.1287 0.02790 0.4775
#> bphigh 0.6306 0.13739 2.7408
#> delivery.timepremature 0.2733 0.06659 0.9889
#> delivery.timelatecomer 0.2145 0.04907 0.8064