Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions learn/statistics/infer/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ Continuing on with our example above, about the average number of hours worked a
#| label: "generate-point"
#| warning: false
#| message: false
set.seed(571)

gss %>%
specify(response = hours) %>%
hypothesize(null = "point", mu = 40) %>%
Expand All @@ -179,6 +181,8 @@ To generate a null distribution for the independence of two variables, we could
#| label: "generate-permute"
#| warning: false
#| message: false
set.seed(328)

gss %>%
specify(partyid ~ age) %>%
hypothesize(null = "independence") %>%
Expand All @@ -193,6 +197,8 @@ Depending on whether you're carrying out computation-based inference or theory-b
#| label: "calculate-point"
#| warning: false
#| message: false
set.seed(265)

gss %>%
specify(response = hours) %>%
hypothesize(null = "point", mu = 40) %>%
Expand All @@ -206,6 +212,8 @@ The output of `calculate()` here shows us the sample statistic (in this case, th
#| label: "specify-diff-in-means"
#| warning: false
#| message: false
set.seed(174)

gss %>%
specify(age ~ college) %>%
hypothesize(null = "independence") %>%
Expand All @@ -227,6 +235,8 @@ point_estimate <- gss %>%
calculate(stat = "mean")

# generate a null distribution
set.seed(693)

null_dist <- gss %>%
specify(response = hours) %>%
hypothesize(null = "point", mu = 40) %>%
Expand Down Expand Up @@ -301,6 +311,8 @@ Generally, to find a null distribution using theory-based methods, use the same
```{r}
#| message: false
#| warning: false
set.seed(533)

null_f_distn <- gss %>%
specify(age ~ partyid) %>%
hypothesize(null = "independence") %>%
Expand Down