Skip to content
Open
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: 6 additions & 6 deletions inst/themes/default/prop.test.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ stmt3 <-

paste0(
"The observed difference in proportions is ",
x$estimate[2] - x$estimate[1],
signif(x$estimate[2] - x$estimate[1], 3),
". The observed proportion for the first group is ",
x$estimate[1],
signif(x$estimate[1], 3),
" (",
prettyNum(x1, big.mark=","),
" events out of a total sample size of ",
prettyNum(n1, big.mark=","),
"). For the second group, the observed proportion is ",
x$estimate[2],
signif(x$estimate[2], 3),
" (",
prettyNum(x2, big.mark=","),
", out of a total sample size of ",
Expand Down Expand Up @@ -125,8 +125,8 @@ stmt4 <-
}
```

`r stmt1`. Using a significance level of `r 1 - attr(x$conf.int, "conf")`, we `r if (x$p.value < 1 - attr(x$conf.int, "conf")) "reject" else "do not reject"` the null hypothesis, and `r stmt2`. `r stmt3`.
`r stmt1`. Using a significance level of `r 1 - signif(attr(x$conf.int, "conf"), 3)`, we `r if (x$p.value < 1 - signif(attr(x$conf.int, "conf"), 3)) "reject" else "do not reject"` the null hypothesis, and `r stmt2`. `r stmt3`.

The confidence interval for the true `r if (onesamp) "population proportion" else "difference in population proportions"` is (`r tidyx$conf.low`, `r tidyx$conf.high`). This interval will contain the true `r if(onesamp) "population proportion" else "difference in population proportions"` 95 times out of 100.
The confidence interval for the true `r if (onesamp) "population proportion" else "difference in population proportions"` is (`r signif(tidyx$conf.low, 3)`, `r signif(tidyx$conf.high, 3)`). Intervals generated with this procedure will contain the true `r if(onesamp) "population proportion" else "difference in population proportions"` `r round(attr(x$conf.int, "conf.level") * 100)` times out of 100.

The p-value for this test is `r x$p.value`. This, formally, is defined as the probability -- if the null hypothesis is true -- of observing a `r if (onesamp) "sample proportion" else "difference in sample proportions"` that is as or more extreme than the `r if (onesamp) "sample proportion" else "difference in sample proportions"` from this data set. In this case, this is the probability -- if the true `r if (onesamp) paste0("population proportion is ", x$null.value) else "population proportions are equal"` -- of observing a `r if (onesamp) "sample proportion" else "difference in sample proportions"` that is greater than `r stmt4`.
The p-value for this test is `r x$p.value`. In other words: if the true `r if (onesamp) "sample proportion" else "difference in sample proportions"` were exactly `r ifelse(is.null(x$null.value), 0, x$null.value)`, and we collected 100 replicate data sets, we would find a discrepancy this large (or larger) in about `r round(x$p.value * 100)` of these 100 cases.