Skip to content

Commit

Permalink
improved equations and CROSSREFs
Browse files Browse the repository at this point in the history
  • Loading branch information
agrogan1 committed Nov 10, 2024
1 parent b700034 commit 2b02575
Show file tree
Hide file tree
Showing 11 changed files with 3,462 additions and 52 deletions.
102 changes: 58 additions & 44 deletions categorical/risks-and-odds-2/risks-and-odds-2.html

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions categorical/risks-and-odds-2/risks-and-odds-2.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ mydata <- data.frame(events, x_happens, risk, odds)

Let's think about risk:

$$\text{risk} = P(\text{event}) = \frac{\text{number of events that happened}}{\text{number of events that happened} + \text{number of events that didn't happen}}$$
$$\text{risk} = P(\text{event happened}) = \frac{\text{number of events}}{\text{number of events} + \text{number of non-events}}$$

# Odds

Expand Down Expand Up @@ -103,8 +103,7 @@ p1 <- plot_ly(hk,
" = ",
odds),
hoverinfo = 'text') %>%
layout(title = "Risks and Odds",
xaxis = list(title='How many times does X happen?',
layout(xaxis = list(title='How many times does X happen?',
showspikes = TRUE),
yaxis = list(title='Risk or Odds',
showspikes = TRUE),
Expand All @@ -114,7 +113,6 @@ t1 <- DT::datatable(hk,
class="compact",
width = "70%",
rownames = FALSE,
caption = 'Risks and Odds',
colnames = c('Total Events',
'How Many Times Does X Happen?',
'Risk',
Expand All @@ -139,6 +137,8 @@ t1 <- DT::datatable(hk,
## Table

```{r}
#| label: tbl-risks-odds
#| tbl-cap: "Table of Risks and Odds"
#| message: false
#| echo: false
Expand All @@ -149,6 +149,8 @@ t1
## Visualization

```{r}
#| label: fig-risks-odds
#| fig-cap: "Visualization of Risks and Odds"
#| message: false
#| echo: false
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 2b02575

Please sign in to comment.