Skip to content

Commit

Permalink
Final tweaks to stats, sorry to push to main but it's kinda last minute
Browse files Browse the repository at this point in the history
  • Loading branch information
avahoffman committed Jul 17, 2024
1 parent 78b9bff commit f068ac9
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
16 changes: 14 additions & 2 deletions modules/Statistics/Statistics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,11 @@ binom_fit <- glm(DieselPM_level ~ PovertyPctl_level, data = calenviroscreen, fam
summary(binom_fit)
```

## Logistic Regression

See this [case study](https://www.opencasestudies.org/ocs-bp-vaping-case-study/#Logistic_regression_%E2%80%9Cby_hand%E2%80%9D_and_by_model) for more information.


## Odds ratios

> An odds ratio (OR) is a measure of association between an exposure and an outcome. The OR represents the odds that an outcome will occur given a particular exposure, compared to the odds of the outcome occurring in the absence of that exposure.
Expand All @@ -663,10 +668,17 @@ calenviroscreen <-
response <- calenviroscreen %>% pull(DieselPM_level)
predictor <- calenviroscreen %>% pull(Traffic_level)
oddsratio(predictor, response)
```

See this [case study](https://www.opencasestudies.org/ocs-bp-vaping-case-study/#Logistic_regression_%E2%80%9Cby_hand%E2%80%9D_and_by_model) for more information.
## Odds ratios {.smaller}

Use `oddsratio(x, y)` from the `epitools()` package to calculate odds ratios.

In this case, we're calculating the odds ratio for whether living in a high traffic area predicts high levels of DieselPM.

```{r}
oddsratio(predictor, response)
```

## Final note

Expand Down
17 changes: 13 additions & 4 deletions modules/Statistics/Statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -4111,6 +4111,10 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>

Number of Fisher Scoring iterations: 16</pre>

</article></slide><slide class=""><hgroup><h2>Logistic Regression</h2></hgroup><article id="logistic-regression-2">

<p>See this <a href='https://www.opencasestudies.org/ocs-bp-vaping-case-study/#Logistic_regression_%E2%80%9Cby_hand%E2%80%9D_and_by_model' title=''>case study</a> for more information.</p>

</article></slide><slide class=""><hgroup><h2>Odds ratios</h2></hgroup><article id="odds-ratios">

<blockquote>
Expand All @@ -4135,8 +4139,15 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
TrafficPctl &lt;= 0.75 ~ 0))

response &lt;- calenviroscreen %&gt;% pull(DieselPM_level)
predictor &lt;- calenviroscreen %&gt;% pull(Traffic_level)
oddsratio(predictor, response)</pre>
predictor &lt;- calenviroscreen %&gt;% pull(Traffic_level)</pre>

</article></slide><slide class=""><hgroup><h2>Odds ratios</h2></hgroup><article id="odds-ratios-2" class="smaller">

<p>Use <code>oddsratio(x, y)</code> from the <code>epitools()</code> package to calculate odds ratios.</p>

<p>In this case, we’re calculating the odds ratio for whether living in a high traffic area predicts high levels of DieselPM.</p>

<pre class = 'prettyprint lang-r'>oddsratio(predictor, response)</pre>

<pre >$data
Outcome
Expand Down Expand Up @@ -4167,8 +4178,6 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
attr(,&quot;method&quot;)
[1] &quot;median-unbiased estimate &amp; mid-p exact CI&quot;</pre>

<p>See this <a href='https://www.opencasestudies.org/ocs-bp-vaping-case-study/#Logistic_regression_%E2%80%9Cby_hand%E2%80%9D_and_by_model' title=''>case study</a> for more information.</p>

</article></slide><slide class=""><hgroup><h2>Final note</h2></hgroup><article id="final-note">

<p>Some final notes:</p>
Expand Down
Binary file modified modules/Statistics/Statistics.pdf
Binary file not shown.

0 comments on commit f068ac9

Please sign in to comment.