OpenIntroStat/ims-tutorials

[Bug]: Tutorial 5, lesson 1. Several bugs.

Closed this issue · 1 comments

Contact Details

mmcisaac@upei.ca

Bug

There are several bugs in Tutorial 5.

In lesson 1, the following code chunks do not run:

Screenshot 2023-11-06 at 9 36 42 AM

and

Screenshot 2023-11-06 at 9 30 49 AM

Furthermore, I am not sure why this code chunk is duplicated:

Screenshot 2023-11-06 at 9 33 19 AM

The first problem can be resolved by adding a setup chunk that gives these exercises access to boot_dist_small_n:

# Create bootstrap distribution for proportion
boot_dist_small_n <- gss2016_small |>
  # Specify the variable and success
  specify(response = consci, success = "High") |>
  # Generate 500 bootstrap reps
  generate(reps = 500, type = "bootstrap") |>
  # Calculate the statistic
  calculate(stat = "prop")

There is another strange thing here: the first of these three exercise chunks always gives the same output (0.06718173), while the other two give different output every time they are run (showing the variability in bootstrapping). I imagine this is because only the first exercise sets a seed.

The second problem can be resolved by making gss2016 in these chunks have access to the meta_region variable:

gss2016 <- gss2016 |>
  mutate(meta_region = fct_collapse(region, pacific = "PACIFIC", other_level = "not pacific"))

This will need to be done through appropriate setup chunks, since this variable is introduced part way through the lesson.

Reproducible Example

See above.

Expected Behavior

No errors.

Session Info

No response

Additional context

No response

I'll work thru these most recent issues later today!