Skip to contents

All of the models in this package are binomial logistic regressions. They can be summarized using the base R function summary().

summary(lr_caused)
#> 
#> Call:
#> glm(formula = jur_caused ~ jur_race_w, family = "binomial", data = bullpen)
#> 
#> Deviance Residuals: 
#>    Min      1Q  Median      3Q     Max  
#> -1.275  -1.032  -1.032   1.140   1.330  
#> 
#> Coefficients:
#>                    Estimate Std. Error z value Pr(>|z|)    
#> (Intercept)        -0.35118    0.05024  -6.990 2.75e-12 ***
#> jur_race_wBlack     0.46857    0.09616   4.873 1.10e-06 ***
#> jur_race_wHispanic  0.57681    0.09992   5.772 7.81e-09 ***
#> jur_race_wAsian     0.44041    0.16749   2.629  0.00855 ** 
#> jur_race_wOther     0.23939    0.15130   1.582  0.11361    
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#> 
#> (Dispersion parameter for binomial family taken to be 1)
#> 
#>     Null deviance: 4324.5  on 3127  degrees of freedom
#> Residual deviance: 4276.9  on 3123  degrees of freedom
#> AIC: 4286.9
#> 
#> Number of Fisher Scoring iterations: 4

If a more presentation-ready summary is desired, the summ function from the jtools package works well.

jtools::summ(lr_caused)
Observations 3128
Dependent variable jur_caused
Type Generalized linear model
Family binomial
Link logit
𝛘²(4) 47.67
Pseudo-R² (Cragg-Uhler) 0.02
Pseudo-R² (McFadden) 0.01
AIC 4286.87
BIC 4317.11
Est. S.E. z val. p
(Intercept) -0.35 0.05 -6.99 0.00
jur_race_wBlack 0.47 0.10 4.87 0.00
jur_race_wHispanic 0.58 0.10 5.77 0.00
jur_race_wAsian 0.44 0.17 2.63 0.01
jur_race_wOther 0.24 0.15 1.58 0.11
Standard errors: MLE

The odds ratios of each model, along with a 95% confidence interval, can be calculated using the following:

calculate_odds(lr_caused)
#> Waiting for profiling to be done...
#>                           OR     2.5 %    97.5 %
#> (Intercept)        0.7038582 0.6376588 0.7764931
#> jur_race_wBlack    1.5977013 1.3235160 1.9296937
#> jur_race_wHispanic 1.7803473 1.4642817 2.1666846
#> jur_race_wAsian    1.5533432 1.1188127 2.1596235
#> jur_race_wOther    1.2704701 0.9434932 1.7086446

To reproduce the figures as they are seen in the paper, the following code can be used:

calculate_odds(lr_caused) |> 
  kableExtra::kable(digits = 3) |> 
  kableExtra::kable_classic(full_width = FALSE, html_font = "Cambria")
#> Waiting for profiling to be done...
OR 2.5 % 97.5 %
(Intercept) 0.704 0.638 0.776
jur_race_wBlack 1.598 1.324 1.930
jur_race_wHispanic 1.780 1.464 2.167
jur_race_wAsian 1.553 1.119 2.160
jur_race_wOther 1.270 0.943 1.709