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_risk(lr_caused)
#>                          RR      p-value      2.5%    97.5%
#> jur_race_wBlack    1.281330 6.164981e-06 1.1593572 1.403303
#> jur_race_wHispanic 1.346342 1.043234e-07 1.2187213 1.473963
#> jur_race_wAsian    1.264336 1.061374e-02 1.0615745 1.467097
#> jur_race_wOther    1.142786 1.225061e-01 0.9615723 1.324000

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

calculate_risk(lr_caused) |> 
  kableExtra::kable(digits = 3) |> 
  kableExtra::kable_classic(full_width = FALSE, html_font = "Cambria")
RR p-value 2.5% 97.5%
jur_race_wBlack 1.281 0.000 1.159 1.403
jur_race_wHispanic 1.346 0.000 1.219 1.474
jur_race_wAsian 1.264 0.011 1.062 1.467
jur_race_wOther 1.143 0.123 0.962 1.324