-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add assertions and clean up comments * Update ordinal test vector names * Write tests for ordinal_tests fxn * Use tryCatches on ordinal tests * Use tryCatch on calculating T1 error * Minor formatting
- Loading branch information
1 parent
5246e8e
commit 5cd9bb9
Showing
7 changed files
with
136 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
# write tests for the ordinal_tests function | ||
|
||
sample_size = 30 | ||
prob0 <- c(.4, .3, .3) | ||
prob1 <- c(.9, .05, .05) | ||
seed <- 10 | ||
sample_prob <- c(0.50, 0.50) | ||
|
||
groups <- assign_groups(sample_size = sample_size, | ||
prob0 = prob0, | ||
prob1 = prob1, | ||
seed = 10, | ||
sample_prob = sample_prob) | ||
|
||
|
||
|
||
test_that("ordinal_tests returns a vector", { | ||
suppressWarnings( | ||
expect_vector(ordinal_tests(groups[["x"]], groups[["y"]])) | ||
) | ||
}) | ||
|
||
test_that("ordinal_tests returns a vector of length 3", { | ||
suppressWarnings( | ||
expect_length(ordinal_tests(groups[["x"]], groups[["y"]]), 6) | ||
) | ||
}) | ||
|
||
test_that("ordinal_tests names the vector correctly", { | ||
suppressWarnings( | ||
expect_named( | ||
ordinal_tests(groups[["x"]], groups[["y"]]), | ||
c("Wilcoxon", "Fisher", "Chi Squared\n(No Correction)", "Chi Squared\n(Correction)", "Prop. Odds", "Coin Indep. Test") | ||
) | ||
) | ||
}) | ||
|