Skip to content

Commit 087de0c

Browse files
authored
set seed for all bootsrap examples. But I didn't render the quarto file. Fixes #65 (#123)
1 parent 4b1a9ac commit 087de0c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

learn/statistics/infer/index.qmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ Continuing on with our example above, about the average number of hours worked a
165165
#| label: "generate-point"
166166
#| warning: false
167167
#| message: false
168+
set.seed(571)
169+
168170
gss %>%
169171
specify(response = hours) %>%
170172
hypothesize(null = "point", mu = 40) %>%
@@ -179,6 +181,8 @@ To generate a null distribution for the independence of two variables, we could
179181
#| label: "generate-permute"
180182
#| warning: false
181183
#| message: false
184+
set.seed(328)
185+
182186
gss %>%
183187
specify(partyid ~ age) %>%
184188
hypothesize(null = "independence") %>%
@@ -193,6 +197,8 @@ Depending on whether you're carrying out computation-based inference or theory-b
193197
#| label: "calculate-point"
194198
#| warning: false
195199
#| message: false
200+
set.seed(265)
201+
196202
gss %>%
197203
specify(response = hours) %>%
198204
hypothesize(null = "point", mu = 40) %>%
@@ -206,6 +212,8 @@ The output of `calculate()` here shows us the sample statistic (in this case, th
206212
#| label: "specify-diff-in-means"
207213
#| warning: false
208214
#| message: false
215+
set.seed(174)
216+
209217
gss %>%
210218
specify(age ~ college) %>%
211219
hypothesize(null = "independence") %>%
@@ -227,6 +235,8 @@ point_estimate <- gss %>%
227235
calculate(stat = "mean")
228236
229237
# generate a null distribution
238+
set.seed(693)
239+
230240
null_dist <- gss %>%
231241
specify(response = hours) %>%
232242
hypothesize(null = "point", mu = 40) %>%
@@ -301,6 +311,8 @@ Generally, to find a null distribution using theory-based methods, use the same
301311
```{r}
302312
#| message: false
303313
#| warning: false
314+
set.seed(533)
315+
304316
null_f_distn <- gss %>%
305317
specify(age ~ partyid) %>%
306318
hypothesize(null = "independence") %>%

0 commit comments

Comments
 (0)