Skip to content

Commit

Permalink
Merge branch 'release-3.0.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Mar 14, 2024
2 parents 45e22ad + 1f22f8e commit 70c6d9a
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 31 deletions.
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 2.2.1
Date: 2024-01-11 12:34:46 UTC
SHA: b4e1ca06ab4213586968a25db8bdf598c1693e9a
Version: 3.0.0
Date: 2024-03-14 14:47:43 UTC
SHA: ecbbd5150e7ab951fded4a2bfe4ab4e072a04b68
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: contingencytables
Title: Statistical Analysis of Contingency Tables
Version: 2.2.1.9010
Version: 3.0.0
Authors@R:
c(
person(
Expand Down Expand Up @@ -45,4 +45,4 @@ URL: https://contingencytables.com/ https://ocbe-uio.github.io/contingencytables
BugReports: https://github.com/ocbe-uio/contingencytables/issues
Imports: MASS, boot, methods
Suggests: testthat
Date: 2024-01-11
Date: 2024-03-14
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# contingencytables (development version)
# contingencytables 3.0.0

* Reached 100% test coverage (#52)
* Removed unused code
Expand Down
2 changes: 1 addition & 1 deletion R/MiettinenNurminen_asymptotic_score_CI_OR_2x2.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ MiettinenNurminen_asymptotic_score_CI_OR_2x2 <- function(n, alpha = 0.05) {
contingencytables_result(
list("lower" = L, "upper" = U, "estimate" = estimate),
sprintf(
"Mietinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
"Miettinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
estimate, 100 * (1 - alpha), L, U
)
)
Expand Down
6 changes: 3 additions & 3 deletions R/MiettinenNurminen_asymptotic_score_CI_difference_2x2.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title The Mietinen-Nurminen asymptotic score confidence interval for the
#' @description The Mietinen-Nurminen asymptotic score confidence interval for the
#' @title The Miettinen-Nurminen asymptotic score confidence interval for the
#' @description The Miettinen-Nurminen asymptotic score confidence interval for the
#' @description difference between probabilities
#' @description Described in Chapter 4 "The 2x2 Table"
#' @param n the observed counts (a 2x2 matrix)
Expand Down Expand Up @@ -56,7 +56,7 @@ MiettinenNurminen_asymptotic_score_CI_difference_2x2 <- function(n, alpha = 0.05
contingencytables_result(
list("lower" = L, "upper" = U, "estimate" = estimate),
sprintf(
"Mietinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
"Miettinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
estimate, 100 * (1 - alpha), L, U
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/MiettinenNurminen_asymptotic_score_CI_ratio_2x2.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ MiettinenNurminen_asymptotic_score_CI_ratio_2x2 <- function(n, alpha = 0.05) {
contingencytables_result(
list("lower" = L, "upper" = U, "estimate" = estimate),
sprintf(
"Mietinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
"Miettinen-Nurminen asymptotic score CI: estimate = %6.4f (%g%% CI %6.4f to %6.4f)",
estimate, 100 * (1 - alpha), L, U
)
)
Expand Down
4 changes: 2 additions & 2 deletions R/Scheffe_type_CIs_paired_cxc.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title ScheffE-type confidence intervals for differences of marginal probabilities
#' @description ScheffE-type confidence intervals for differences of marginal probabilities
#' @title Scheffe-type confidence intervals for differences of marginal probabilities
#' @description Scheffe-type confidence intervals for differences of marginal probabilities
#' @description Described in Chapter 9 "The Paired kxk Table"
#' @param n the observed table (a cxc matrix)
#' @param alpha the nominal level, e.g. 0.05 for 95% CIs
Expand Down
6 changes: 3 additions & 3 deletions R/Scheffe_type_CIs_rxc.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#' @title The ScheffE-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
#' @description The ScheffE-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
#' @title The Scheffe-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
#' @description The Scheffe-type simultaneous confidence intervals for the differences pi_1|i - pi_1|j
#' @description Described in Chapter 7 "The rxc Table"
#' @param n the observed counts (an rx2 vector)
#' @param alpha the nominal level, e.g. 0.05 for 95# CIs
Expand Down Expand Up @@ -27,7 +27,7 @@ Scheffe_type_CIs_rxc <- function(n, alpha = 0.05) {
}
}

# Simultaneous confidence intervals with ScheffE adjustment
# Simultaneous confidence intervals with Scheffe adjustment
L <- rep(0, C)
U <- rep(0, C)
Scheffe <- qchisq(1 - alpha, r - 1)
Expand Down
2 changes: 1 addition & 1 deletion R/the_paired_cxc_table_nominal.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ the_paired_cxc_table_nominal <- function(n, alpha = 0.05) {


cat_sprintf("\nTests and confidence intervals for individual categories:\n")
cat_sprintf("\nCategory Estimate ScheffE 95%%CI Bonferroni 95%%CI P-value*\n")
cat_sprintf("\nCategory Estimate Scheffe 95%%CI Bonferroni 95%%CI P-value*\n")
cat_sprintf("-------------------------------------------------------------------------------\n")
for (i in 1:c) {
tmp <- Scheffe_type_CIs_paired_cxc(n, alpha)
Expand Down
2 changes: 1 addition & 1 deletion R/validateArguments.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#' validate their arguments.
#' @param x named list containing function arguments and their values
#' @param types named vector of types for `x`
#' @return Nothing if all aguments fit their type. An error message otherwise.
#' @return Nothing if all arguments fit their type. An error message otherwise.
#' @author Waldir Leoncio
#' @details Accepted validation types are:
#' \itemize{
Expand Down
49 changes: 45 additions & 4 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
## R CMD check results
# contingencytables 3.0.0

0 errors | 0 warnings | 1 note
* Reached 100% test coverage (#52)
* Removed unused code
* Improved handling of edge cases
* Restricted `Cumulative_models_for_rxc()` and `Cumulative_models_for_2xc()` to 2 columns
* Added `plot()` method for `Exact_unconditional_test_2x2()` and `McNemar_exact_unconditional_test_paired_2x2()` (#53)
* Standardized names of objects in the output (#35)

* Improved internals:refactoring (#41), increased test coverage (#52)
* Fixed upper CI limit on `stratified_2x2_tables()` (thanks to Zhen Wang)
# Test environments
- R-hub windows-x86_64-devel (r-devel)
- R-hub ubuntu-gcc-release (r-release)
- R-hub fedora-clang-devel (r-devel)

# R CMD check results
❯ On windows-x86_64-devel (r-devel)
checking for non-standard things in the check directory ... NOTE
Found the following files/directories:
''NULL''

❯ On windows-x86_64-devel (r-devel)
checking for detritus in the temp directory ... NOTE
Found the following files/directories:
'lastMiKTeXException'

❯ On ubuntu-gcc-release (r-release)
checking examples ... [34s/93s] NOTE
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
MidP_multinomial_test_1xc 3.908 0.001 11.123
Exact_multinomial_test_1xc 3.810 0.004 10.800
CochranArmitage_exact_cond_midP_tests_rx2 3.323 0.007 8.749

❯ On ubuntu-gcc-release (r-release), fedora-clang-devel (r-devel)
checking HTML version of manual ... NOTE
Skipping checking HTML validation: no command 'tidy' found

❯ On fedora-clang-devel (r-devel)
checking examples ... [35s/98s] NOTE
Examples with CPU (user + system) or elapsed time > 5s
user system elapsed
MidP_multinomial_test_1xc 4.161 0.008 11.308
Exact_multinomial_test_1xc 4.079 0.012 10.254
CochranArmitage_exact_cond_midP_tests_rx2 3.521 0.003 10.113
the_rxc_table 2.002 0.008 5.574

0 errors ✔ | 0 warnings ✔ | 5 notes ✖
4 changes: 2 additions & 2 deletions man/MiettinenNurminen_asymptotic_score_CI_difference_2x2.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/Scheffe_type_CIs_paired_cxc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/Scheffe_type_CIs_rxc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/validateArguments.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-ch4.R
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ test_that("Chapter 4 functions basically work", {
)
expect_output(
object = print(MiettinenNurminen_asymptotic_score_CI_difference_2x2(matrix(c(2e6, 2, 2, 2e6), 2))),
regexp = "Mietinen-Nurminen .+ 1.0000 \\(95% CI 1.0000 to 1.0000\\)"
regexp = "Miettinen-Nurminen .+ 1.0000 \\(95% CI 1.0000 to 1.0000\\)"
)
expect_output(
object = print(MiettinenNurminen_asymptotic_score_CI_difference_2x2(matrix(c(2, 2e6, 2e6, 2), 2))),
regexp = "Mietinen-Nurminen .+ -1.0000 \\(95% CI -1.0000 to -1.0000\\)"
regexp = "Miettinen-Nurminen .+ -1.0000 \\(95% CI -1.0000 to -1.0000\\)"
)
expect_output(
object = print(MiettinenNurminen_asymptotic_score_CI_OR_2x2(lampasona_2013)),
Expand Down

0 comments on commit 70c6d9a

Please sign in to comment.