Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ISCAM
Title: Companion to the Book "Investigating Statistical Concepts,
Applications, and Methods"
Version: 0.0.0.9000
Version: 0.1.0
Authors@R: c(
person("Beth", "Chance", , "bchance@calpoly.edu", role = c("cre", "aut", "cph")),
person("Visruth", "Srimath Kandali", , "visruth@gmail.com", role = "aut",
Expand Down Expand Up @@ -34,4 +34,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
69 changes: 69 additions & 0 deletions tests/testthat/_snaps/binomial-suite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# iscambinomprob returns expected tail probabilities

Code
res_lower$output
Output
[1] "Probability 3 and below = 0.3822806 "

---

Code
res_upper$output
Output
[1] "Probability 7 and above = 0.05476188 "

# iscaminvbinom solves the correct quantile

Code
res_lower$output
Output
[1] "The observation with at most 0.1 probability at or below is 4 "

---

Code
res_upper$output
Output
[1] "The observation with at most 0.1 probability at or above is 12 "

# iscambinomnorm executes for each direction

Code
capture_plot_result(iscambinomnorm(10, 20, 0.5, "below"))$output
Output
[1] " binomial: 0.5881 "
[2] " normal approx: 0.5 "
[3] " normal approx with continuity: 0.5885 "

---

Code
capture_plot_result(iscambinomnorm(10, 20, 0.5, "above"))$output
Output
[1] " binomial: 0.5881 "
[2] " normal approx: 0.5 "
[3] " normal approx with continuity: 0.5885 "

# iscambinompower reports rejection probabilities

Code
res$output
Output
[1] "Null: Probability 15 and above = 0.02069473 "
[2] "Alternative: Probability 15 and above = 0.125599 "

# iscambinomtest matches binom.test results

Code
res$output
Output
[1] ""
[2] "Exact Binomial Test"
[3] ""
[4] "Data: observed successes = 18, sample size = 30, sample proportion = 0.6"
[5] ""
[6] "Null hypothesis : pi = 0.5 "
[7] "Alternative hypothesis: pi <> 0.5 "
[8] "p-value: 0.36159 "
[9] "95 % Confidence interval for pi: ( 0.40603 , 0.77344 ) "

39 changes: 39 additions & 0 deletions tests/testthat/_snaps/chisq-hyper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# iscamchisqprob returns formatted upper-tail probability

Code
res$output
Output
[1] "probability: 0.1718 "

# iscamhyperprob matches hypergeometric tails

Code
res_lower$output
Output
[1] "Probability 2 and below = 0.7038184 "

---

Code
res_upper$output
Output
[1] "Probability 3 and above = 0.2961816 "

# iscamhypernorm reports tail probabilities and normal approximations

Code
res_lower$output
Output
[1] " hypergeometric: 0.7038 "
[2] " normal approx: 0.5 "
[3] " normal approx with continuity: 0.6963 "

---

Code
res_upper$output
Output
[1] " hypergeometric: 0.2962 "
[2] " normal approx: 0.1521 "
[3] " normal approx with continuity: 0.3037 "

37 changes: 0 additions & 37 deletions tests/testthat/_snaps/iscamsummary.md

This file was deleted.

36 changes: 36 additions & 0 deletions tests/testthat/_snaps/normal-suite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# iscamnormprob returns formatted probabilities

Code
res_above$output
Output
[1] "probability: 0.025 "

---

Code
res_between$output
Output
[1] "probability: 0.6827 "

# iscamnormpower reports null and alternative rejection rates

Code
res$output
Output
[1] "Null: Probability 0.592 and above = 0.05 "
[2] "Alt: Probability 0.592 and above = 0.2253625 "

# iscaminvnorm reports requested quantiles

Code
res_below$output
Output
[1] "The observation with 0.05 probability below is -1.645 "

---

Code
res_outside$output
Output
[1] "There is 0.1 probability outside -1.645 and 1.645 "

69 changes: 0 additions & 69 deletions tests/testthat/_snaps/overlayDensities/addt-plot.svg

This file was deleted.

74 changes: 0 additions & 74 deletions tests/testthat/_snaps/overlayDensities/addtnorm-plot.svg

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
83 changes: 83 additions & 0 deletions tests/testthat/_snaps/overlayDensities/t-and-normal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions tests/testthat/_snaps/overlayDensities/t-distribution.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading