Skip to content

Commit

Permalink
moved exercise prep to setup chunk (#241)
Browse files Browse the repository at this point in the history
  • Loading branch information
npaterno authored Jun 5, 2024
1 parent 515c080 commit 9823d56
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions 05-infer/05-lesson/05-05-lesson.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ knitr::opts_chunk$set(fig.align = "center",
manhattan <- read_csv("data/manhattan.csv")
set.seed(20170801)
ncbirths_complete_visits <- ncbirths |>
filter(!is.na(visits))
# Hash generation helpers
# Should ideally be loaded from the imstutorials package when it exists
is_server_context <- function(.envir) {
Expand Down Expand Up @@ -732,12 +735,6 @@ Fantastic! Quick mental check before you move on: How would you interpret this i

Suppose now we're interested in the standard deviation of the number of doctor's visits throughout pregnancy.

```{r doctor_4-setup, include=FALSE}
# Remove NA visits
ncbirths_complete_visits <- ncbirths |>
filter(!is.na(visits))
```

For the number of doctor's visits, first generate 15000 bootstrap replicates and calculate their standard deviations.

```{r doctor_4, exercise=TRUE}
Expand Down

0 comments on commit 9823d56

Please sign in to comment.