Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Joscelinrocha committed Aug 15, 2024
2 parents 50b9382 + 92b89e8 commit de12e61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions vignettes/chi_squared.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,8 @@ This statistic seems like it would be quite unlikely if income class self-identi
```{r get-p-value-gof, warning = FALSE, message = FALSE}
# calculate the p-value
p_value_gof <- null_dist_gof %>%
get_p_value(observed_gof_statistic,
get_p_value(
observed_gof_statistic,
direction = "greater"
)
Expand All @@ -242,7 +243,8 @@ pchisq(observed_gof_statistic$stat, 5, lower.tail = FALSE)
Again, equivalently to the theory-based approach shown above, the package supplies a wrapper function, `chisq_test()`, to carry out Chi-Squared goodness of fit tests on tidy data. The syntax goes like this:

```{r chisq-gof-wrapper, message = FALSE, warning = FALSE}
chisq_test(gss,
chisq_test(
gss,
response = finrela,
p = c(
"far below average" = 1 / 6,
Expand Down
6 changes: 4 additions & 2 deletions vignettes/observed_stat_examples.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ Alternatively, using the `observe()` wrapper to calculate the observed statistic

```{r}
d_hat <- gss %>%
observe(college ~ sex,
observe(
college ~ sex,
success = "no degree",
stat = "diff in props", order = c("female", "male")
)
Expand Down Expand Up @@ -665,7 +666,8 @@ null_dist %>%
Alternatively, using the `chisq_test` wrapper:

```{r}
chisq_test(gss,
chisq_test(
gss,
response = finrela,
p = c(
"far below average" = 1 / 6,
Expand Down

0 comments on commit de12e61

Please sign in to comment.