Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Typo - Chp [15], Lab 1, [Questionable Use of count() Function]

Open
#489 0 comments 0 reactions 1 assignee View on GitHub

@mine-cetinkaya-rundel is already working on this.

Since Oct 15, 2024.

Assessment

This issue has not been assessed yet.

Description

  • Chapter number: 15

  • Section number: Lab: Foundations for statistical inference - Sampling distributions

  • Other location identifier, if any (e.g., figure number, table number, footnote number, etc.):
    Section Titled:
    Interlude: Sampling distributions

  • Original text:
    global_monitor %>% rep_sample_n(size = 50, reps = 15000, replace = TRUE) %>% count(scientist_work)

  • Suggestion for corrected text:
    global_monitor %>% rep_sample_n(size = 50, reps = 15000, replace = TRUE) %>% mutate(scientist_work = as.factor(scientist_work)) |> count(scientist_work, .drop = FALSE)

  • Justification for suggestion:
    As currently written, you will filter out samples with a 0% success rate. In order to include counts of 0, you need to code the variable of interest as a factor and use the .drop argument of the count() function to retain all levels. Leaving out counts of 0 means graphing the sampling distribution will omit the left-most values. While this doesn't often occur with samples of size 50 and ample proportion p, can be an issue with small samples such as in Exercise 8 of this lab.

Dominant language
JavaScript
Stars
948
Forks
211
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenIntroStat/ims

All issues in OpenIntroStat/ims

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.