8.3 LR in R: Predicting Recidvism (2): Estimate model

  • Estimate model in R: glm(y ~ x1 + x2, family = binomial, data = data_train)
fit <- glm(as.factor(is_recid) ~ age + priors_count, 
           family = binomial, 
           data = data_train)
cat(paste(capture.output(summary(fit))[11:14], collapse="\n"))
##               Estimate Std. Error z value Pr(>|z|)    
## (Intercept)   1.101001   0.097597   11.28   <2e-16 ***
## age          -0.049831   0.002861  -17.42   <2e-16 ***
## priors_count  0.159982   0.008236   19.43   <2e-16 ***
  • R output shows log odds: e.g., a one-unit increase in age is associated with an increase in the log odds of is_recid by -0.05 units
  • Difficult to interpret.. much easier to use predicted probabilities