-
Notifications
You must be signed in to change notification settings - Fork 0
/
odds-ratios.Rmd
44 lines (34 loc) · 1.04 KB
/
odds-ratios.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
---
title: "Calculating Odds Ratios"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Calculating Odds Ratios}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
options(knitr.table.format = "html")
library(juryR)
```
All of the models in this package are binomial logistic regressions. They can be summarized using the base R function `summary()`.
```{r}
summary(lr_caused)
```
If a more presentation-ready summary is desired, the `summ` function from the [`jtools`](https://jtools.jacob-long.com) package works well.
```{r}
jtools::summ(lr_caused)
```
The odds ratios of each model, along with a 95% confidence interval, can be calculated using the following:
```{r}
calculate_odds(lr_caused)
```
To reproduce the figures as they are seen in the paper, the following code can be used:
```{r}
calculate_odds(lr_caused) |>
kableExtra::kable(digits = 3) |>
kableExtra::kable_classic(full_width = FALSE, html_font = "Cambria")
```