You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parts D and E belong in a later chapter. If you want students to investigate further after part B, maybe something like this:
## More on Nurse Gilbert
How might we look at the data graphically? The main tool we have in this course is `point_plot()`, but for a point-plot we need the y-axis variable to be numerical. The function `zero_one()` cn be used to convert a categorical variable to a numerical variable that has the value 1 for a selected level of the categorical varialble and 0 for all other levels. Let's use it here to create a new variable called `death_num` that is 1 if there was a death, 0 if there was no death:
```{r}
Gilbert2 <-
Gilbert |>
mutate(death_num = zero_one(death, one = "yes"))
knitr::kable(
Gilbert2 |> head(10),
caption = "First 10 rows of Gilbert2"
)
```
Now we can make a point-plot:
```{r}
Gilbert2 |>
point_plot(
death_num ~ gilbert
)
```
From this plot alone, it's hard to see whether there is difference in the proportion of deaths when Gilbert was on-duty vs. off-duty. However, we can ask for model-annotation:
```{r}
Gilbert2 |>
point_plot(
death_num ~ gilbert,
annot = "model"
)
```
The blue regions indicate the indicate the ranges of plausible values for the *probability* of death, when Gilbert was on-duty vs. off-duty.
Do you believe that the data provide strong evidence that a death was more probable when Gilbert was on duty? What feature(s) of the plot led you to your answer?
The text was updated successfully, but these errors were encountered:
Parts D and E belong in a later chapter. If you want students to investigate further after part B, maybe something like this:
The text was updated successfully, but these errors were encountered: