Skip to content

Commit f068ac9

Browse files
committed
Final tweaks to stats, sorry to push to main but it's kinda last minute
1 parent 78b9bff commit f068ac9

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

modules/Statistics/Statistics.Rmd

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,11 @@ binom_fit <- glm(DieselPM_level ~ PovertyPctl_level, data = calenviroscreen, fam
638638
summary(binom_fit)
639639
```
640640

641+
## Logistic Regression
642+
643+
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.
644+
645+
641646
## Odds ratios
642647

643648
> 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.
@@ -663,10 +668,17 @@ calenviroscreen <-
663668
664669
response <- calenviroscreen %>% pull(DieselPM_level)
665670
predictor <- calenviroscreen %>% pull(Traffic_level)
666-
oddsratio(predictor, response)
667671
```
668672

669-
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.
673+
## Odds ratios {.smaller}
674+
675+
Use `oddsratio(x, y)` from the `epitools()` package to calculate odds ratios.
676+
677+
In this case, we're calculating the odds ratio for whether living in a high traffic area predicts high levels of DieselPM.
678+
679+
```{r}
680+
oddsratio(predictor, response)
681+
```
670682

671683
## Final note
672684

modules/Statistics/Statistics.html

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4111,6 +4111,10 @@ <h1 data-config-title><!-- populated from slide_config.json --></h1>
41114111

41124112
Number of Fisher Scoring iterations: 16</pre>
41134113

4114+
</article></slide><slide class=""><hgroup><h2>Logistic Regression</h2></hgroup><article id="logistic-regression-2">
4115+
4116+
<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>
4117+
41144118
</article></slide><slide class=""><hgroup><h2>Odds ratios</h2></hgroup><article id="odds-ratios">
41154119

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

41374141
response &lt;- calenviroscreen %&gt;% pull(DieselPM_level)
4138-
predictor &lt;- calenviroscreen %&gt;% pull(Traffic_level)
4139-
oddsratio(predictor, response)</pre>
4142+
predictor &lt;- calenviroscreen %&gt;% pull(Traffic_level)</pre>
4143+
4144+
</article></slide><slide class=""><hgroup><h2>Odds ratios</h2></hgroup><article id="odds-ratios-2" class="smaller">
4145+
4146+
<p>Use <code>oddsratio(x, y)</code> from the <code>epitools()</code> package to calculate odds ratios.</p>
4147+
4148+
<p>In this case, we’re calculating the odds ratio for whether living in a high traffic area predicts high levels of DieselPM.</p>
4149+
4150+
<pre class = 'prettyprint lang-r'>oddsratio(predictor, response)</pre>
41404151

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

4170-
<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>
4171-
41724181
</article></slide><slide class=""><hgroup><h2>Final note</h2></hgroup><article id="final-note">
41734182

41744183
<p>Some final notes:</p>

modules/Statistics/Statistics.pdf

8.61 KB
Binary file not shown.

0 commit comments

Comments
 (0)