diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 6bd33992..1a6cbbad 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -1,100 +1,18 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -# -# NOTE: This workflow is overkill for most R packages and -# check-standard.yaml is likely a better choice. -# usethis::use_github_action("check-standard") will install it. +name: R-CMD-check on: push: - branches: main + branches: [main, master] pull_request: - branches: main - schedule: - - cron: '0 8 * * 0' # Every Sunday at midnight PST = Monday at 08:00 UTC - -name: R-CMD-check.yaml - -permissions: read-all - + branches: [main, master, dev] +permissions: + contents: read jobs: R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macos-latest, r: 'release'} - - - {os: windows-latest, r: 'release'} - # use 4.0 or 4.1 to check with rtools40's older compiler - - {os: windows-latest, r: 'oldrel-3'} - - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - env: - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - if: github.event_name != 'schedule' - with: - upload-snapshots: true - build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' - - - name: ๐Ÿงช Run R-CMD-check and save summary - if: github.event_name == 'schedule' && github.repository_owner == 'poissonconsulting' - - env: - OS: ${{ matrix.config.os }} - R: ${{ matrix.config.r }} - run: | - check <- rcmdcheck::rcmdcheck( - args = "--no-manual", - error_on = "never" - ) - result <- toupper(check$status) - log_text <- paste( - utils::capture.output(print(check)), - collapse = "\n" - ) - filename <- paste0(Sys.getenv("OS"), "-R-", Sys.getenv("R"), ".txt") - cat(result, "\n---\n", log_text, "\n", file = filename) - shell: Rscript {0} - - - name: ๐Ÿ’พ Upload status artifact - if: github.event_name == 'schedule' && github.repository_owner == 'poissonconsulting' - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.config.os }}-R-${{ matrix.config.r }} - path: ${{ matrix.config.os }}-R-${{ matrix.config.r }}.txt - retention-days: 6 - - - name: ๐Ÿ’พ Upload snapshot artifacts - if: github.event_name == 'schedule' && github.repository_owner == 'poissonconsulting' - uses: actions/upload-artifact@v4 - with: - name: snapshots-${{ matrix.config.os }}-R-${{ matrix.config.r }} - path: tests/testthat/_snaps - retention-days: 6 + uses: poissonconsulting/.github/.github/workflows/R-CMD-check.yaml@v1 + with: + tier: cran + jags: false + cmdstan: false + tex: true + private: false + secrets: inherit diff --git a/.github/workflows/check-no-suggests.yaml b/.github/workflows/check-no-suggests.yaml new file mode 100644 index 00000000..1ea1454e --- /dev/null +++ b/.github/workflows/check-no-suggests.yaml @@ -0,0 +1,14 @@ +name: check-no-suggests +on: + push: + branches: [main, master] + pull_request: + branches: [main, master, dev] +permissions: + contents: read +jobs: + check-no-suggests: + uses: poissonconsulting/.github/.github/workflows/check-no-suggests.yaml@v1 + with: + private: false + secrets: inherit diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index bfc9f4db..baeb8862 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,49 +1,18 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +name: pkgdown on: push: branches: [main, master] pull_request: + branches: [main, master, dev] release: types: [published] workflow_dispatch: - -name: pkgdown.yaml - -permissions: read-all - +permissions: + contents: write jobs: pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - permissions: - contents: write - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages ๐Ÿš€ - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@v4.5.0 - with: - clean: false - branch: gh-pages - folder: docs + uses: poissonconsulting/.github/.github/workflows/pkgdown.yaml@v1 + with: + cmdstan: false + private: false + secrets: inherit diff --git a/.github/workflows/rhub.yaml b/.github/workflows/rhub.yaml index 74ec7b05..feb49e1f 100644 --- a/.github/workflows/rhub.yaml +++ b/.github/workflows/rhub.yaml @@ -5,6 +5,10 @@ # rhub::rhub_setup() # # It is unlikely that you need to modify this file manually. +# +# Distributed to CRAN-tier packages by poissonconsulting/.github tools/sync-ci.sh. +# It is dispatch-triggered (run via rhub::rhub_check()), not a push/PR check, so it +# is vendored as-is rather than called as a reusable workflow. name: R-hub run-name: "${{ github.event.inputs.id }}: ${{ github.event.inputs.name || format('Manually run by {0}', github.triggering_actor) }}" diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 792f71ee..bf82a621 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -1,62 +1,16 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +name: test-coverage on: push: - branches: main + branches: [main, master] pull_request: - -name: test-coverage.yaml - -permissions: read-all - + branches: [main, master, dev] +permissions: + contents: read jobs: test-coverage: - runs-on: ubuntu-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - - steps: - - uses: actions/checkout@v4 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::covr, any::xml2 - needs: coverage - - - name: Test coverage - run: | - cov <- covr::package_coverage( - quiet = FALSE, - clean = FALSE, - install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") - ) - print(cov) - covr::to_cobertura(cov) - shell: Rscript {0} - - - uses: codecov/codecov-action@v7 - with: - # Fail if error if not on PR, or if on PR and token is given - fail_ci_if_error: ${{ github.event_name != 'pull_request' || secrets.CODECOV_TOKEN }} - files: ./cobertura.xml - plugins: noop - disable_search: true - token: ${{ secrets.CODECOV_TOKEN }} - - - name: Show testthat output - if: always() - run: | - ## -------------------------------------------------------------------- - find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true - shell: bash - - - name: Upload test results - if: failure() - uses: actions/upload-artifact@v4 - with: - name: coverage-test-failures - path: ${{ runner.temp }}/package + uses: poissonconsulting/.github/.github/workflows/test-coverage.yaml@v1 + with: + cmdstan: false + tex: true + private: false + secrets: inherit diff --git a/R/glance.R b/R/glance.R index 4eb15cb0..e704d8d0 100644 --- a/R/glance.R +++ b/R/glance.R @@ -23,7 +23,11 @@ generics::glance npars <- npars(x) log_lik <- logLik(x) aic <- 2 * npars - 2 * log_lik - aicc <- aic + 2 * npars * (npars + 1) / (nobs - npars - 1) + if (isTRUE(nobs <= npars)) { + aicc <- Inf + } else { + aicc <- aic + 2 * npars * (npars + 1) / (nobs - npars - 1) + } tibble( dist = dist, @@ -39,6 +43,10 @@ generics::glance #' #' Gets a tibble with a single row for each distribution. #' +#' The `aicc` is `Inf` if the number of observations is less than +#' the number of parameters plus two as the small sample size +#' correction is undefined. +#' #' @inheritParams params #' @return A tidy tibble of the distributions. #' @family generics diff --git a/R/hcp-average.R b/R/hcp-average.R index 63870d11..ee3edd96 100644 --- a/R/hcp-average.R +++ b/R/hcp-average.R @@ -58,6 +58,11 @@ hcp_average <- function( ) } + ## Compute on the unique values so the various ci/est functions (some of + ## which collapse duplicates via group_by()) agree on the row structure, + ## then re-expand to the input `value` vector preserving order and duplicates. + uvalue <- unique(value) + est_same <- FALSE ci_fun <- if (!ci) { hcp_noci @@ -75,7 +80,7 @@ hcp_average <- function( hcp <- ci_fun( x, - value = value, + value = uvalue, ci = ci, level = level, nboot = nboot, @@ -98,7 +103,7 @@ hcp_average <- function( ) if (est_same) { - return(hcp) + return(hcp[match(value, hcp$value), ]) } est_fun <- if (est_method == "multi") { @@ -108,7 +113,7 @@ hcp_average <- function( } est <- est_fun( x, - value, + uvalue, ci = FALSE, level = level, nboot = nboot, @@ -128,5 +133,6 @@ hcp_average <- function( ci_method = "MACL", hc = hc ) - replace_estimates(hcp, est) + hcp <- replace_estimates(hcp, est) + hcp[match(value, hcp$value), ] } diff --git a/man/glance.fitdists.Rd b/man/glance.fitdists.Rd index b990ff11..6fd93eb3 100644 --- a/man/glance.fitdists.Rd +++ b/man/glance.fitdists.Rd @@ -19,6 +19,11 @@ A tidy tibble of the distributions. \description{ Gets a tibble with a single row for each distribution. } +\details{ +The \code{aicc} is \code{Inf} if the number of observations is less than +the number of parameters plus two as the small sample size +correction is undefined. +} \examples{ fits <- ssd_fit_dists(ssddata::ccme_boron) glance(fits, wt = TRUE) diff --git a/tests/testthat/_snaps/hp/hc_fix.csv b/tests/testthat/_snaps/hp/hc_fix.csv deleted file mode 100644 index e68e5dd4..00000000 --- a/tests/testthat/_snaps/hp/hc_fix.csv +++ /dev/null @@ -1,7 +0,0 @@ -dist,conc,est,se,lcl,ucl,wt,level,est_method,ci_method,boot_method,nboot,pboot,dists,samples -average,1,1.87689,1.55011,0.365888,5.53175,1,0.95,multi,multi_fixed,parametric,100,1,"c(""lgumbel"", ""lnorm"")","c(`000000001_multi` = 4.31288, `000000002_multi` = 1.9065, `000000003_multi` = 1.26989, `000000004_multi` = 0.539061, `000000005_multi` = 0.922982, `000000006_multi` = 8.63338, `000000007_multi` = 0.765501, `000000008_multi` = 2.20945, `000000009_multi` = 2.69635, `000000010_multi` = 0.30066, `000000011_multi` = 3.41082, `000000012_multi` = 3.4317, `000000013_multi` = 4.03756, `000000014_multi` = 0.826098, `000000015_multi` = 1.18608, `000000016_multi` = 1.13332, `000000017_multi` = 2.50298, `000000018_multi` = 3.74454, -`000000019_multi` = 2.11866, `000000020_multi` = 4.14998, `000000021_multi` = 2.46302, `000000022_multi` = 1.45919, `000000023_multi` = 2.93791, `000000024_multi` = 3.74223, `000000025_multi` = 0.37635, `000000026_multi` = 0.59799, `000000027_multi` = 1.49933, `000000028_multi` = 2.2558, `000000029_multi` = 2.24383, `000000030_multi` = 2.4284, `000000031_multi` = 3.78674, `000000032_multi` = 1.80487, `000000033_multi` = 4.11683, `000000034_multi` = 1.81454, `000000035_multi` = 0.991044, `000000036_multi` = 4.01655, -`000000037_multi` = 2.322, `000000038_multi` = 2.00874, `000000039_multi` = 2.7587, `000000040_multi` = 0.750708, `000000041_multi` = 2.89913, `000000042_multi` = 0.180924, `000000043_multi` = 0.564688, `000000044_multi` = 4.3119, `000000045_multi` = 8.08831, `000000046_multi` = 1.13276, `000000047_multi` = 2.66367, `000000048_multi` = 0.95344, `000000049_multi` = 0.999222, `000000050_multi` = 1.7821, `000000051_multi` = 2.96802, `000000052_multi` = 5.01671, `000000053_multi` = 2.86176, `000000054_multi` = 1.56626, -`000000055_multi` = 2.82062, `000000056_multi` = 4.91228, `000000057_multi` = 2.61967, `000000058_multi` = 2.13417, `000000059_multi` = 2.00604, `000000060_multi` = 1.58299, `000000061_multi` = 3.58274, `000000062_multi` = 4.83651, `000000063_multi` = 5.48443, `000000064_multi` = 1.63129, `000000065_multi` = 3.54829, `000000066_multi` = 1.5721, `000000067_multi` = 1.87572, `000000068_multi` = 2.99637, `000000069_multi` = 5.57457, `000000070_multi` = 1.73332, `000000071_multi` = 1.84463, `000000072_multi` = 1.58764, -`000000073_multi` = 0.764211, `000000074_multi` = 1.55605, `000000075_multi` = 4.75899, `000000076_multi` = 2.76916, `000000077_multi` = 0.849553, `000000078_multi` = 1.41308, `000000079_multi` = 0.650074, `000000080_multi` = 3.28291, `000000081_multi` = 2.67211, `000000082_multi` = 0.922486, `000000083_multi` = 0.356423, `000000084_multi` = 1.24128, `000000085_multi` = 2.24721, `000000086_multi` = 0.838084, `000000087_multi` = 1.78431, `000000088_multi` = 0.617978, `000000089_multi` = 3.19475, `000000090_multi` = 1.70557, -`000000091_multi` = 1.22937, `000000092_multi` = 1.09922, `000000093_multi` = 0.399914, `000000094_multi` = 1.12012, `000000095_multi` = 0.603786, `000000096_multi` = 3.15656, `000000097_multi` = 1.65803, `000000098_multi` = 2.48818, `000000099_multi` = 2.1293, `000000100_multi` = 2.69049)" diff --git a/tests/testthat/_snaps/hp/hc_unfix.csv b/tests/testthat/_snaps/hp/hc_unfix.csv deleted file mode 100644 index ef498489..00000000 --- a/tests/testthat/_snaps/hp/hc_unfix.csv +++ /dev/null @@ -1,7 +0,0 @@ -dist,conc,est,se,lcl,ucl,wt,level,est_method,ci_method,boot_method,nboot,pboot,dists,samples -average,1,1.87689,1.37403,0.0959774,4.81702,1,0.95,multi,multi_free,parametric,100,1,"c(""lgumbel"", ""lnorm"")","c(`000000001_multi` = 2.07429, `000000002_multi` = 1.85448, `000000003_multi` = 0.0412633, `000000004_multi` = 0.0895156, `000000005_multi` = 0.835909, `000000006_multi` = 3.27391, `000000007_multi` = 0.724325, `000000008_multi` = 0.855626, `000000009_multi` = 0.213419, `000000010_multi` = 0.103119, `000000011_multi` = 3.42288, `000000012_multi` = 2.46332, `000000013_multi` = 3.97425, `000000014_multi` = 0.853213, `000000015_multi` = 1.21224, `000000016_multi` = 1.15934, `000000017_multi` = 1.90293, -`000000018_multi` = 3.64396, `000000019_multi` = 1.01582, `000000020_multi` = 3.22912, `000000021_multi` = 1.0355, `000000022_multi` = 1.29695, `000000023_multi` = 2.95155, `000000024_multi` = 3.59746, `000000025_multi` = 0.356283, `000000026_multi` = 0.611681, `000000027_multi` = 1.45437, `000000028_multi` = 1.55299, `000000029_multi` = 1.8463, `000000030_multi` = 2.42898, `000000031_multi` = 3.4657, `000000032_multi` = 1.04543, `000000033_multi` = 3.78432, `000000034_multi` = 0.818129, `000000035_multi` = 1.01388, -`000000036_multi` = 3.7122, `000000037_multi` = 1.37174, `000000038_multi` = 1.54846, `000000039_multi` = 2.78089, `000000040_multi` = 0.539168, `000000041_multi` = 2.80494, `000000042_multi` = 0.156594, `000000043_multi` = 0.552692, `000000044_multi` = 4.19026, `000000045_multi` = 8.0273, `000000046_multi` = 0.93824, `000000047_multi` = 1.62259, `000000048_multi` = 0.919237, `000000049_multi` = 0.0434711, `000000050_multi` = 1.79131, `000000051_multi` = 2.44568, `000000052_multi` = 5.01287, `000000053_multi` = 2.64182, -`000000054_multi` = 1.51865, `000000055_multi` = 2.12564, `000000056_multi` = 4.86561, `000000057_multi` = 1.33088, `000000058_multi` = 0.838115, `000000059_multi` = 1.78423, `000000060_multi` = 0.49822, `000000061_multi` = 1.2523, `000000062_multi` = 4.7633, `000000063_multi` = 1.33568, `000000064_multi` = 0.325326, `000000065_multi` = 2.65784, `000000066_multi` = 1.35304, `000000067_multi` = 1.66819, `000000068_multi` = 2.72068, `000000069_multi` = 1.33939, `000000070_multi` = 1.71487, `000000071_multi` = 1.76948, -`000000072_multi` = 1.52316, `000000073_multi` = 0.146504, `000000074_multi` = 1.58016, `000000075_multi` = 4.62105, `000000076_multi` = 2.52378, `000000077_multi` = 0.491896, `000000078_multi` = 1.21004, `000000079_multi` = 0.43576, `000000080_multi` = 0.457131, `000000081_multi` = 0.792217, `000000082_multi` = 0.737765, `000000083_multi` = 0.366826, `000000084_multi` = 1.19688, `000000085_multi` = 1.73864, `000000086_multi` = 0.761162, `000000087_multi` = 1.24972, `000000088_multi` = 0.243573, -`000000089_multi` = 3.15828, `000000090_multi` = 1.44412, `000000091_multi` = 1.23973, `000000092_multi` = 0.624251, `000000093_multi` = 0.351439, `000000094_multi` = 1.12367, `000000095_multi` = 0.301422, `000000096_multi` = 3.11513, `000000097_multi` = 1.67859, `000000098_multi` = 2.45013, `000000099_multi` = 1.04751, `000000100_multi` = 0.322637)" diff --git a/tests/testthat/_snaps/hp/hp_30.csv b/tests/testthat/_snaps/hp/hp_30.csv deleted file mode 100644 index 72a45e37..00000000 --- a/tests/testthat/_snaps/hp/hp_30.csv +++ /dev/null @@ -1,8 +0,0 @@ -dist,conc,est,se,lcl,ucl,wt,level,est_method,ci_method,boot_method,nboot,pboot,dists,samples -lnorm_lnorm,1,14.0375,3.7122,7.66497,26.329,1,0.95,cdf,percentile,parametric,100,0.95,lnorm_lnorm,"c(`000000001_lnorm_lnorm` = 21.9048, `000000002_lnorm_lnorm` = 19.0984, `000000003_lnorm_lnorm` = 19.7098, `000000004_lnorm_lnorm` = 18.9173, `000000005_lnorm_lnorm` = 19.7669, `000000006_lnorm_lnorm` = 22.2542, `000000007_lnorm_lnorm` = 17.6752, `000000008_lnorm_lnorm` = 21.7758, `000000009_lnorm_lnorm` = 23.5247, `000000010_lnorm_lnorm` = 26.3773, `000000012_lnorm_lnorm` = 20.6888, `000000014_lnorm_lnorm` = 21.703, `000000015_lnorm_lnorm` = 21.1384, `000000016_lnorm_lnorm` = 21.6932, `000000017_lnorm_lnorm` = 22.5676, -`000000018_lnorm_lnorm` = 22.5328, `000000019_lnorm_lnorm` = 6.60594, `000000020_lnorm_lnorm` = 22.7354, `000000021_lnorm_lnorm` = 21.3289, `000000022_lnorm_lnorm` = 18.3075, `000000023_lnorm_lnorm` = 21.3175, `000000024_lnorm_lnorm` = 21.077, `000000025_lnorm_lnorm` = 20.8324, `000000026_lnorm_lnorm` = 8.05119, `000000027_lnorm_lnorm` = 19.8597, `000000028_lnorm_lnorm` = 27.3051, `000000029_lnorm_lnorm` = 23.5006, `000000030_lnorm_lnorm` = 23.8007, `000000031_lnorm_lnorm` = 7.45701, `000000032_lnorm_lnorm` = 23.6514, -`000000033_lnorm_lnorm` = 23.9126, `000000034_lnorm_lnorm` = 17.7634, `000000035_lnorm_lnorm` = 19.7886, `000000036_lnorm_lnorm` = 23.8404, `000000038_lnorm_lnorm` = 19.8812, `000000039_lnorm_lnorm` = 22.1943, `000000040_lnorm_lnorm` = 23.1973, `000000041_lnorm_lnorm` = 19.5314, `000000042_lnorm_lnorm` = 22.7873, `000000043_lnorm_lnorm` = 22.8698, `000000044_lnorm_lnorm` = 18.9926, `000000045_lnorm_lnorm` = 20.7766, `000000046_lnorm_lnorm` = 18.0683, `000000047_lnorm_lnorm` = 25.5754, `000000048_lnorm_lnorm` = 21.0398, -`000000049_lnorm_lnorm` = 22.6463, `000000050_lnorm_lnorm` = 24.4119, `000000051_lnorm_lnorm` = 22.261, `000000052_lnorm_lnorm` = 22.8452, `000000053_lnorm_lnorm` = 21.8698, `000000054_lnorm_lnorm` = 23.2408, `000000055_lnorm_lnorm` = 24.0347, `000000056_lnorm_lnorm` = 21.0383, `000000057_lnorm_lnorm` = 21.5909, `000000058_lnorm_lnorm` = 19.8791, `000000059_lnorm_lnorm` = 19.0136, `000000060_lnorm_lnorm` = 15.5949, `000000061_lnorm_lnorm` = 20.2945, `000000062_lnorm_lnorm` = 22.4464, `000000063_lnorm_lnorm` = 21.3007, -`000000064_lnorm_lnorm` = 24.4892, `000000065_lnorm_lnorm` = 15.7782, `000000066_lnorm_lnorm` = 20.1205, `000000067_lnorm_lnorm` = 18.422, `000000068_lnorm_lnorm` = 17.4014, `000000069_lnorm_lnorm` = 20.0939, `000000070_lnorm_lnorm` = 23.946, `000000071_lnorm_lnorm` = 24.3471, `000000072_lnorm_lnorm` = 22.713, `000000073_lnorm_lnorm` = 27.4183, `000000074_lnorm_lnorm` = 19.207, `000000075_lnorm_lnorm` = 19.155, `000000077_lnorm_lnorm` = 6.92782, `000000078_lnorm_lnorm` = 25.385, `000000079_lnorm_lnorm` = 25.0585, -`000000080_lnorm_lnorm` = 17.9097, `000000081_lnorm_lnorm` = 21.284, `000000082_lnorm_lnorm` = 20.887, `000000083_lnorm_lnorm` = 17.7218, `000000084_lnorm_lnorm` = 19.6934, `000000085_lnorm_lnorm` = 20.6512, `000000086_lnorm_lnorm` = 18.7977, `000000087_lnorm_lnorm` = 21.0112, `000000088_lnorm_lnorm` = 23.6375, `000000089_lnorm_lnorm` = 22.2089, `000000090_lnorm_lnorm` = 20.429, `000000091_lnorm_lnorm` = 21.1707, `000000093_lnorm_lnorm` = 23.3401, `000000094_lnorm_lnorm` = 18.1016, `000000095_lnorm_lnorm` = 22.3362, -`000000096_lnorm_lnorm` = 20.5781, `000000097_lnorm_lnorm` = 26.2392, `000000098_lnorm_lnorm` = 21.2249, `000000099_lnorm_lnorm` = 21.9668, `000000100_lnorm_lnorm` = 23.0759)" diff --git a/tests/testthat/_snaps/weibull/hc_anona.csv b/tests/testthat/_snaps/weibull/hc_anona.csv deleted file mode 100644 index 94882dcb..00000000 --- a/tests/testthat/_snaps/weibull/hc_anona.csv +++ /dev/null @@ -1,60 +0,0 @@ -dist,proportion,est,se,lcl,ucl,wt,level,est_method,ci_method,boot_method,nboot,pboot,dists,samples -weibull,0.05,6.42593,20.0853,0.839929,65.8784,1,0.95,cdf,percentile,parametric,1000,1,weibull,"c(`000000001_weibull` = 7.89881, `000000002_weibull` = 1.06997, `000000003_weibull` = 50.0369, `000000004_weibull` = 9.12268, `000000005_weibull` = 29.0039, `000000006_weibull` = 22.1187, `000000007_weibull` = 7.18138, `000000008_weibull` = 24.1653, `000000009_weibull` = 39.5255, `000000010_weibull` = 16.8784, `000000011_weibull` = 2.03542, `000000012_weibull` = 6.04392, `000000013_weibull` = 8.3494, `000000014_weibull` = 17.9857, `000000015_weibull` = 7.80251, `000000016_weibull` = 11.9892, `000000017_weibull` = 0.570056, -`000000018_weibull` = 1.73675, `000000019_weibull` = 43.6656, `000000020_weibull` = 3.8728, `000000021_weibull` = 11.9142, `000000022_weibull` = 8.09079, `000000023_weibull` = 5.09413, `000000024_weibull` = 45.4954, `000000025_weibull` = 8.96644, `000000026_weibull` = 5.71562, `000000027_weibull` = 39.2471, `000000028_weibull` = 1.91155, `000000029_weibull` = 3.95022, `000000030_weibull` = 13.1646, `000000031_weibull` = 17.1453, `000000032_weibull` = 20.3492, `000000033_weibull` = 18.0316, `000000034_weibull` = 72.0993, -`000000035_weibull` = 2.45826, `000000036_weibull` = 1.01518, `000000037_weibull` = 19.2373, `000000038_weibull` = 26.3569, `000000039_weibull` = 3.67068, `000000040_weibull` = 15.4407, `000000041_weibull` = 16.8976, `000000042_weibull` = 20.9641, `000000043_weibull` = 10.518, `000000044_weibull` = 1.65734, `000000045_weibull` = 2.48964, `000000046_weibull` = 7.35374, `000000047_weibull` = 10.9121, `000000048_weibull` = 1.6318, `000000049_weibull` = 17.7849, `000000050_weibull` = 1.32351, `000000051_weibull` = 32.8952, -`000000052_weibull` = 1.18622, `000000053_weibull` = 5.55932, `000000054_weibull` = 20.1889, `000000055_weibull` = 70.0187, `000000056_weibull` = 2.82047, `000000057_weibull` = 7.21588, `000000058_weibull` = 29.7901, `000000059_weibull` = 6.77315, `000000060_weibull` = 1.09662, `000000061_weibull` = 34.381, `000000062_weibull` = 2.79135, `000000063_weibull` = 5.30566, `000000064_weibull` = 6.34621, `000000065_weibull` = 6.82718, `000000066_weibull` = 25.8919, `000000067_weibull` = 2.78399, `000000068_weibull` = 8.26782, -`000000069_weibull` = 3.03559, `000000070_weibull` = 22.9112, `000000071_weibull` = 5.18329, `000000072_weibull` = 4.87442, `000000073_weibull` = 8.82713, `000000074_weibull` = 7.74969, `000000075_weibull` = 2.79374, `000000076_weibull` = 5.40645, `000000077_weibull` = 5.83757, `000000078_weibull` = 2.58223, `000000079_weibull` = 17.895, `000000080_weibull` = 22.449, `000000081_weibull` = 6.87384, `000000082_weibull` = 4.89776, `000000083_weibull` = 9.14669, `000000084_weibull` = 16.8564, `000000085_weibull` = 1.04697, -`000000086_weibull` = 28.236, `000000087_weibull` = 20.9471, `000000088_weibull` = 10.8927, `000000089_weibull` = 3.30952, `000000090_weibull` = 7.8809, `000000091_weibull` = 4.01601, `000000092_weibull` = 1.74442, `000000093_weibull` = 3.69256, `000000094_weibull` = 28.5327, `000000095_weibull` = 28.5135, `000000096_weibull` = 6.96941, `000000097_weibull` = 5.97607, `000000098_weibull` = 6.37188, `000000099_weibull` = 5.61422, `000000100_weibull` = 17.1345, `000000101_weibull` = 10.6013, `000000102_weibull` = 48.0696, -`000000103_weibull` = 16.1629, `000000104_weibull` = 5.35059, `000000105_weibull` = 14.7141, `000000106_weibull` = 5.92994, `000000107_weibull` = 28.7523, `000000108_weibull` = 3.65127, `000000109_weibull` = 2.65374, `000000110_weibull` = 1.33969, `000000111_weibull` = 224.084, `000000112_weibull` = 7.55911, `000000113_weibull` = 51.287, `000000114_weibull` = 3.12466, `000000115_weibull` = 1.18624, `000000116_weibull` = 7.28186, `000000117_weibull` = 10.9904, `000000118_weibull` = 1.93409, `000000119_weibull` = 2.65541, -`000000120_weibull` = 6.28691, `000000121_weibull` = 36.542, `000000122_weibull` = 1.84659, `000000123_weibull` = 6.38427, `000000124_weibull` = 6.89813, `000000125_weibull` = 28.9331, `000000126_weibull` = 10.6812, `000000127_weibull` = 1.6324, `000000128_weibull` = 9.57975, `000000129_weibull` = 52.5297, `000000130_weibull` = 3.54681, `000000131_weibull` = 34.6021, `000000132_weibull` = 6.39007, `000000133_weibull` = 0.461342, `000000134_weibull` = 29.0784, `000000135_weibull` = 4.95248, `000000136_weibull` = 3.61671, -`000000137_weibull` = 5.94284, `000000138_weibull` = 2.42438, `000000139_weibull` = 2.14911, `000000140_weibull` = 2.74245, `000000141_weibull` = 17.2685, `000000142_weibull` = 22.4926, `000000143_weibull` = 15.344, `000000144_weibull` = 1.96149, `000000145_weibull` = 8.2464, `000000146_weibull` = 7.98435, `000000147_weibull` = 7.51271, `000000148_weibull` = 10.1239, `000000149_weibull` = 2.12778, `000000150_weibull` = 12.9806, `000000151_weibull` = 13.2527, `000000152_weibull` = 14.1967, `000000153_weibull` = 0.143226, -`000000154_weibull` = 7.35901, `000000155_weibull` = 4.92914, `000000156_weibull` = 2.31952, `000000157_weibull` = 26.1904, `000000158_weibull` = 2.68085, `000000159_weibull` = 4.61586, `000000160_weibull` = 13.5681, `000000161_weibull` = 1.37088, `000000162_weibull` = 8.47574, `000000163_weibull` = 0.978102, `000000164_weibull` = 31.2694, `000000165_weibull` = 19.1177, `000000166_weibull` = 4.08246, `000000167_weibull` = 22.3273, `000000168_weibull` = 2.05451, `000000169_weibull` = 5.0529, `000000170_weibull` = 13.9303, -`000000171_weibull` = 8.61715, `000000172_weibull` = 19.7397, `000000173_weibull` = 6.71318, `000000174_weibull` = 27.4044, `000000175_weibull` = 7.28693, `000000176_weibull` = 1.80074, `000000177_weibull` = 4.31666, `000000178_weibull` = 5.12141, `000000179_weibull` = 12.8011, `000000180_weibull` = 13.5353, `000000181_weibull` = 8.56893, `000000182_weibull` = 39.3663, `000000183_weibull` = 6.32333, `000000184_weibull` = 5.99983, `000000185_weibull` = 29.1863, `000000186_weibull` = 103.93, `000000187_weibull` = 0.301843, -`000000188_weibull` = 8.58353, `000000189_weibull` = 24.2252, `000000190_weibull` = 2.25102, `000000191_weibull` = 2.52189, `000000192_weibull` = 7.08092, `000000193_weibull` = 21.3132, `000000194_weibull` = 12.1515, `000000195_weibull` = 9.11856, `000000196_weibull` = 32.5712, `000000197_weibull` = 11.8345, `000000198_weibull` = 12.5487, `000000199_weibull` = 10.917, `000000200_weibull` = 12.0425, `000000201_weibull` = 41.1204, `000000202_weibull` = 24.2047, `000000203_weibull` = 34.4939, `000000204_weibull` = 6.62158, -`000000205_weibull` = 1.78329, `000000206_weibull` = 11.9855, `000000207_weibull` = 16.416, `000000208_weibull` = 12.8519, `000000209_weibull` = 72.1627, `000000210_weibull` = 2.03954, `000000211_weibull` = 15.8262, `000000212_weibull` = 3.67227, `000000213_weibull` = 5.2976, `000000214_weibull` = 8.12765, `000000215_weibull` = 6.12332, `000000216_weibull` = 54.6687, `000000217_weibull` = 2.03886, `000000218_weibull` = 13.5505, `000000219_weibull` = 1.09109, `000000220_weibull` = 6.04521, `000000221_weibull` = 10.1188, -`000000222_weibull` = 5.50393, `000000223_weibull` = 1.71739, `000000224_weibull` = 5.58357, `000000225_weibull` = 8.87411, `000000226_weibull` = 7.72635, `000000227_weibull` = 21.3469, `000000228_weibull` = 2.53829, `000000229_weibull` = 4.27087, `000000230_weibull` = 1.56518, `000000231_weibull` = 3.72763, `000000232_weibull` = 8.85306, `000000233_weibull` = 9.93457, `000000234_weibull` = 15.0873, `000000235_weibull` = 5.3808, `000000236_weibull` = 3.21833, `000000237_weibull` = 5.79535, `000000238_weibull` = 7.96288, -`000000239_weibull` = 3.50857, `000000240_weibull` = 4.94207, `000000241_weibull` = 10.6336, `000000242_weibull` = 16.0122, `000000243_weibull` = 40.8055, `000000244_weibull` = 2.54236, `000000245_weibull` = 13.7327, `000000246_weibull` = 6.98828, `000000247_weibull` = 26.7669, `000000248_weibull` = 2.17667, `000000249_weibull` = 1.45508, `000000250_weibull` = 13.0206, `000000251_weibull` = 3.25168, `000000252_weibull` = 7.70423, `000000253_weibull` = 18.6958, `000000254_weibull` = 5.16812, `000000255_weibull` = 13.0857, -`000000256_weibull` = 13.86, `000000257_weibull` = 15.3015, `000000258_weibull` = 8.5018, `000000259_weibull` = 3.06039, `000000260_weibull` = 7.37682, `000000261_weibull` = 79.275, `000000262_weibull` = 12.5884, `000000263_weibull` = 11.254, `000000264_weibull` = 21.884, `000000265_weibull` = 15.2609, `000000266_weibull` = 25.222, `000000267_weibull` = 12.1305, `000000268_weibull` = 7.98714, `000000269_weibull` = 12.0211, `000000270_weibull` = 1.34363, `000000271_weibull` = 9.32561, `000000272_weibull` = 5.15373, -`000000273_weibull` = 10.5069, `000000274_weibull` = 13.9148, `000000275_weibull` = 16.1626, `000000276_weibull` = 5.64589, `000000277_weibull` = 5.97315, `000000278_weibull` = 9.73134, `000000279_weibull` = 4.17538, `000000280_weibull` = 13.7185, `000000281_weibull` = 11.8243, `000000282_weibull` = 17.5709, `000000283_weibull` = 5.07297, `000000284_weibull` = 22.9815, `000000285_weibull` = 2.82846, `000000286_weibull` = 8.21063, `000000287_weibull` = 6.59477, `000000288_weibull` = 4.29986, `000000289_weibull` = 5.02493, -`000000290_weibull` = 28.4617, `000000291_weibull` = 5.0546, `000000292_weibull` = 4.48064, `000000293_weibull` = 0.519378, `000000294_weibull` = 3.09113, `000000295_weibull` = 28.091, `000000296_weibull` = 33.5765, `000000297_weibull` = 51.0332, `000000298_weibull` = 18.4032, `000000299_weibull` = 6.47745, `000000300_weibull` = 20.0379, `000000301_weibull` = 56.4329, `000000302_weibull` = 0.487145, `000000303_weibull` = 7.21868, `000000304_weibull` = 82.1432, `000000305_weibull` = 28.9542, `000000306_weibull` = 31.649, -`000000307_weibull` = 1.49505, `000000308_weibull` = 57.618, `000000309_weibull` = 0.556206, `000000310_weibull` = 10.5596, `000000311_weibull` = 2.56523, `000000312_weibull` = 27.9536, `000000313_weibull` = 11.4718, `000000314_weibull` = 18.8253, `000000315_weibull` = 5.77089, `000000316_weibull` = 4.54263, `000000317_weibull` = 73.5468, `000000318_weibull` = 2.36635, `000000319_weibull` = 4.18398, `000000320_weibull` = 4.49475, `000000321_weibull` = 15.707, `000000322_weibull` = 10.6251, `000000323_weibull` = 2.73755, -`000000324_weibull` = 13.9713, `000000325_weibull` = 9.34662, `000000326_weibull` = 2.29113, `000000327_weibull` = 4.47855, `000000328_weibull` = 22.5306, `000000329_weibull` = 2.48039, `000000330_weibull` = 61.5398, `000000331_weibull` = 3.94171, `000000332_weibull` = 3.75159, `000000333_weibull` = 6.44104, `000000334_weibull` = 0.277108, `000000335_weibull` = 3.83718, `000000336_weibull` = 33.6422, `000000337_weibull` = 8.38734, `000000338_weibull` = 15.4571, `000000339_weibull` = 33.23, `000000340_weibull` = 6.80743, -`000000341_weibull` = 14.7509, `000000342_weibull` = 17.1821, `000000343_weibull` = 28.1868, `000000344_weibull` = 0.554409, `000000345_weibull` = 2.07158, `000000346_weibull` = 4.36059, `000000347_weibull` = 6.28036, `000000348_weibull` = 9.9349, `000000349_weibull` = 9.94721, `000000350_weibull` = 8.74324, `000000351_weibull` = 12.9177, `000000352_weibull` = 7.10272, `000000353_weibull` = 12.7026, `000000354_weibull` = 7.55013, `000000355_weibull` = 15.3681, `000000356_weibull` = 32.8762, `000000357_weibull` = 29.0007, -`000000358_weibull` = 6.51254, `000000359_weibull` = 34.0381, `000000360_weibull` = 13.0201, `000000361_weibull` = 10.4466, `000000362_weibull` = 30.3084, `000000363_weibull` = 10.2515, `000000364_weibull` = 1.38278, `000000365_weibull` = 3.2986, `000000366_weibull` = 4.48934, `000000367_weibull` = 2.44318, `000000368_weibull` = 2.04066, `000000369_weibull` = 6.81957, `000000370_weibull` = 19.2952, `000000371_weibull` = 24.2225, `000000372_weibull` = 6.41446, `000000373_weibull` = 12.1526, `000000374_weibull` = 3.60588, -`000000375_weibull` = 1.76126, `000000376_weibull` = 32.6153, `000000377_weibull` = 10.5144, `000000378_weibull` = 13.583, `000000379_weibull` = 14.7872, `000000380_weibull` = 6.2358, `000000381_weibull` = 6.83938, `000000382_weibull` = 8.16299, `000000383_weibull` = 3.80958, `000000384_weibull` = 0.901758, `000000385_weibull` = 5.67643, `000000386_weibull` = 8.88885, `000000387_weibull` = 7.19521, `000000388_weibull` = 0.859144, `000000389_weibull` = 11.0599, `000000390_weibull` = 54.932, `000000391_weibull` = 1.95726, -`000000392_weibull` = 0.788791, `000000393_weibull` = 5.19102, `000000394_weibull` = 8.79288, `000000395_weibull` = 17.1788, `000000396_weibull` = 3.47636, `000000397_weibull` = 98.3494, `000000398_weibull` = 1.10735, `000000399_weibull` = 3.77347, `000000400_weibull` = 19.978, `000000401_weibull` = 51.4453, `000000402_weibull` = 0.875319, `000000403_weibull` = 0.210773, `000000404_weibull` = 7.83416, `000000405_weibull` = 16.2126, `000000406_weibull` = 23.3555, `000000407_weibull` = 1.9675, `000000408_weibull` = 11.3176, -`000000409_weibull` = 11.0376, `000000410_weibull` = 2.99966, `000000411_weibull` = 4.88518, `000000412_weibull` = 3.23035, `000000413_weibull` = 1.73311, `000000414_weibull` = 59.27, `000000415_weibull` = 15.7069, `000000416_weibull` = 6.26738, `000000417_weibull` = 15.9143, `000000418_weibull` = 2.3391, `000000419_weibull` = 18.4887, `000000420_weibull` = 1.24406, `000000421_weibull` = 13.745, `000000422_weibull` = 29.0649, `000000423_weibull` = 25.3448, `000000424_weibull` = 13.1498, `000000425_weibull` = 8.84597, -`000000426_weibull` = 2.1185, `000000427_weibull` = 44.9404, `000000428_weibull` = 1.87369, `000000429_weibull` = 54.6265, `000000430_weibull` = 0.840628, `000000431_weibull` = 5.73577, `000000432_weibull` = 25.4814, `000000433_weibull` = 8.16343, `000000434_weibull` = 1.19398, `000000435_weibull` = 14.8084, `000000436_weibull` = 1.38884, `000000437_weibull` = 35.6641, `000000438_weibull` = 12.8526, `000000439_weibull` = 18.7603, `000000440_weibull` = 9.21702, `000000441_weibull` = 7.94473, `000000442_weibull` = 6.42146, -`000000443_weibull` = 1.70953, `000000444_weibull` = 16.1651, `000000445_weibull` = 5.46558, `000000446_weibull` = 3.55586, `000000447_weibull` = 6.12194, `000000448_weibull` = 49.8493, `000000449_weibull` = 10.307, `000000450_weibull` = 4.17965, `000000451_weibull` = 76.9661, `000000452_weibull` = 45.9901, `000000453_weibull` = 18.5322, `000000454_weibull` = 4.97769, `000000455_weibull` = 4.78508, `000000456_weibull` = 14.394, `000000457_weibull` = 11.8027, `000000458_weibull` = 17.4619, `000000459_weibull` = 3.57168, -`000000460_weibull` = 6.12772, `000000461_weibull` = 2.72279, `000000462_weibull` = 6.86939, `000000463_weibull` = 2.81629, `000000464_weibull` = 5.73149, `000000465_weibull` = 5.06848, `000000466_weibull` = 0.341223, `000000467_weibull` = 11.6499, `000000468_weibull` = 0.891002, `000000469_weibull` = 11.2608, `000000470_weibull` = 52.2953, `000000471_weibull` = 3.40678, `000000472_weibull` = 7.88058, `000000473_weibull` = 7.96216, `000000474_weibull` = 3.40384, `000000475_weibull` = 32.949, `000000476_weibull` = 78.4206, -`000000477_weibull` = 6.42501, `000000478_weibull` = 7.78013, `000000479_weibull` = 8.23825, `000000480_weibull` = 30.6881, `000000481_weibull` = 7.91037, `000000482_weibull` = 5.95804, `000000483_weibull` = 16.6329, `000000484_weibull` = 16.2937, `000000485_weibull` = 17.6908, `000000486_weibull` = 1.39487, `000000487_weibull` = 5.18779, `000000488_weibull` = 11.8188, `000000489_weibull` = 8.97721, `000000490_weibull` = 9.42853, `000000491_weibull` = 2.40317, `000000492_weibull` = 5.06491, `000000493_weibull` = 4.6245, -`000000494_weibull` = 27.1642, `000000495_weibull` = 23.2079, `000000496_weibull` = 2.10843, `000000497_weibull` = 1.4032, `000000498_weibull` = 2.131, `000000499_weibull` = 8.25864, `000000500_weibull` = 6.29708, `000000501_weibull` = 3.96885, `000000502_weibull` = 3.52597, `000000503_weibull` = 17.1788, `000000504_weibull` = 33.0789, `000000505_weibull` = 21.8239, `000000506_weibull` = 5.48503, `000000507_weibull` = 28.4404, `000000508_weibull` = 47.7232, `000000509_weibull` = 29.0467, `000000510_weibull` = 8.26491, -`000000511_weibull` = 17.8232, `000000512_weibull` = 2.09857, `000000513_weibull` = 2.96449, `000000514_weibull` = 4.755, `000000515_weibull` = 1.39902, `000000516_weibull` = 7.41477, `000000517_weibull` = 9.80806, `000000518_weibull` = 10.5286, `000000519_weibull` = 3.65082, `000000520_weibull` = 11.3892, `000000521_weibull` = 38.5335, `000000522_weibull` = 0.664294, `000000523_weibull` = 18.1465, `000000524_weibull` = 28.0962, `000000525_weibull` = 14.406, `000000526_weibull` = 6.92245, `000000527_weibull` = 4.14766, -`000000528_weibull` = 1.31082, `000000529_weibull` = 26.3112, `000000530_weibull` = 5.3134, `000000531_weibull` = 4.81644, `000000532_weibull` = 2.67408, `000000533_weibull` = 5.67722, `000000534_weibull` = 30.3247, `000000535_weibull` = 4.48942, `000000536_weibull` = 5.01935, `000000537_weibull` = 7.76996, `000000538_weibull` = 6.77013, `000000539_weibull` = 0.390406, `000000540_weibull` = 14.774, `000000541_weibull` = 21.3812, `000000542_weibull` = 2.4305, `000000543_weibull` = 12.6707, `000000544_weibull` = 2.97342, -`000000545_weibull` = 51.7377, `000000546_weibull` = 2.46614, `000000547_weibull` = 8.86347, `000000548_weibull` = 3.19655, `000000549_weibull` = 19.5076, `000000550_weibull` = 22.5745, `000000551_weibull` = 5.19171, `000000552_weibull` = 1.70325, `000000553_weibull` = 19.9225, `000000554_weibull` = 9.31872, `000000555_weibull` = 1.01105, `000000556_weibull` = 4.24713, `000000557_weibull` = 5.41935, `000000558_weibull` = 38.1076, `000000559_weibull` = 28.354, `000000560_weibull` = 64.7971, `000000561_weibull` = 3.09919, -`000000562_weibull` = 2.33608, `000000563_weibull` = 3.28822, `000000564_weibull` = 5.95388, `000000565_weibull` = 3.05888, `000000566_weibull` = 11.7653, `000000567_weibull` = 15.8791, `000000568_weibull` = 3.49081, `000000569_weibull` = 1.41579, `000000570_weibull` = 2.86884, `000000571_weibull` = 25.6838, `000000572_weibull` = 28.6806, `000000573_weibull` = 3.40831, `000000574_weibull` = 5.04681, `000000575_weibull` = 16.0253, `000000576_weibull` = 30.1885, `000000577_weibull` = 6.49951, `000000578_weibull` = 1.80816, -`000000579_weibull` = 13.7436, `000000580_weibull` = 32.8796, `000000581_weibull` = 2.07724, `000000582_weibull` = 6.13847, `000000583_weibull` = 12.091, `000000584_weibull` = 5.5756, `000000585_weibull` = 5.29085, `000000586_weibull` = 5.94434, `000000587_weibull` = 39.1568, `000000588_weibull` = 11.3507, `000000589_weibull` = 48.7412, `000000590_weibull` = 46.9381, `000000591_weibull` = 5.27178, `000000592_weibull` = 9.58594, `000000593_weibull` = 25.1346, `000000594_weibull` = 7.82138, `000000595_weibull` = 6.97658, -`000000596_weibull` = 41.4798, `000000597_weibull` = 4.08869, `000000598_weibull` = 2.50253, `000000599_weibull` = 29.6135, `000000600_weibull` = 24.3129, `000000601_weibull` = 2.99139, `000000602_weibull` = 15.1422, `000000603_weibull` = 9.97959, `000000604_weibull` = 13.083, `000000605_weibull` = 12.083, `000000606_weibull` = 6.79494, `000000607_weibull` = 26.628, `000000608_weibull` = 15.0396, `000000609_weibull` = 27.1029, `000000610_weibull` = 26.9731, `000000611_weibull` = 0.668251, `000000612_weibull` = 18.7729, -`000000613_weibull` = 0.174962, `000000614_weibull` = 16.377, `000000615_weibull` = 2.07472, `000000616_weibull` = 3.17767, `000000617_weibull` = 21.1537, `000000618_weibull` = 4.46302, `000000619_weibull` = 4.34065, `000000620_weibull` = 1.11473, `000000621_weibull` = 5.44317, `000000622_weibull` = 10.7674, `000000623_weibull` = 3.64766, `000000624_weibull` = 1.84146, `000000625_weibull` = 66.1111, `000000626_weibull` = 8.61305, `000000627_weibull` = 8.47606, `000000628_weibull` = 25.3102, `000000629_weibull` = 3.49254, -`000000630_weibull` = 21.4744, `000000631_weibull` = 1.98128, `000000632_weibull` = 19.94, `000000633_weibull` = 2.21213, `000000634_weibull` = 49.4209, `000000635_weibull` = 2.98233, `000000636_weibull` = 9.85828, `000000637_weibull` = 15.6881, `000000638_weibull` = 1.43295, `000000639_weibull` = 12.8051, `000000640_weibull` = 9.55381, `000000641_weibull` = 5.6145, `000000642_weibull` = 4.25231, `000000643_weibull` = 6.07474, `000000644_weibull` = 7.67731, `000000645_weibull` = 6.10257, `000000646_weibull` = 20.3129, -`000000647_weibull` = 1.57468, `000000648_weibull` = 0.980504, `000000649_weibull` = 3.39598, `000000650_weibull` = 8.0982, `000000651_weibull` = 17.7974, `000000652_weibull` = 4.07143, `000000653_weibull` = 9.23263, `000000654_weibull` = 30.9502, `000000655_weibull` = 8.82768, `000000656_weibull` = 6.5865, `000000657_weibull` = 1.17011, `000000658_weibull` = 4.05372, `000000659_weibull` = 3.19274, `000000660_weibull` = 2.64652, `000000661_weibull` = 3.84497, `000000662_weibull` = 5.25866, `000000663_weibull` = 5.59368, -`000000664_weibull` = 1.03801, `000000665_weibull` = 0.559953, `000000666_weibull` = 5.5505, `000000667_weibull` = 78.7836, `000000668_weibull` = 13.0249, `000000669_weibull` = 18.1268, `000000670_weibull` = 26.0135, `000000671_weibull` = 5.70797, `000000672_weibull` = 15.8734, `000000673_weibull` = 3.6875, `000000674_weibull` = 5.90833, `000000675_weibull` = 5.03023, `000000676_weibull` = 4.30273, `000000677_weibull` = 15.4958, `000000678_weibull` = 1.93089, `000000679_weibull` = 1.87053, `000000680_weibull` = 2.2068, -`000000681_weibull` = 7.17525, `000000682_weibull` = 4.96911, `000000683_weibull` = 15.2985, `000000684_weibull` = 3.25676, `000000685_weibull` = 3.24788, `000000686_weibull` = 7.48606, `000000687_weibull` = 3.04151, `000000688_weibull` = 8.01563, `000000689_weibull` = 26.6214, `000000690_weibull` = 0.698842, `000000691_weibull` = 34.3796, `000000692_weibull` = 3.0526, `000000693_weibull` = 65.8725, `000000694_weibull` = 12.4289, `000000695_weibull` = 1.51489, `000000696_weibull` = 6.27669, `000000697_weibull` = 13.8708, -`000000698_weibull` = 31.6536, `000000699_weibull` = 26.2212, `000000700_weibull` = 7.22727, `000000701_weibull` = 6.90378, `000000702_weibull` = 1.15388, `000000703_weibull` = 22.0244, `000000704_weibull` = 1.75725, `000000705_weibull` = 1.00358, `000000706_weibull` = 13.7902, `000000707_weibull` = 1.66347, `000000708_weibull` = 11.4034, `000000709_weibull` = 7.16034, `000000710_weibull` = 9.32859, `000000711_weibull` = 3.75494, `000000712_weibull` = 0.491065, `000000713_weibull` = 32.3276, `000000714_weibull` = 44.2535, -`000000715_weibull` = 34.1403, `000000716_weibull` = 9.26336, `000000717_weibull` = 1.09184, `000000718_weibull` = 29.0191, `000000719_weibull` = 8.83679, `000000720_weibull` = 296.966, `000000721_weibull` = 4.30182, `000000722_weibull` = 9.44291, `000000723_weibull` = 2.34776, `000000724_weibull` = 3.76452, `000000725_weibull` = 5.67752, `000000726_weibull` = 15.742, `000000727_weibull` = 26.7253, `000000728_weibull` = 4.49419, `000000729_weibull` = 7.33488, `000000730_weibull` = 9.31605, `000000731_weibull` = 1.74011, -`000000732_weibull` = 15.5328, `000000733_weibull` = 22.5055, `000000734_weibull` = 28.4991, `000000735_weibull` = 3.99464, `000000736_weibull` = 39.1982, `000000737_weibull` = 29.0942, `000000738_weibull` = 15.907, `000000739_weibull` = 76.0676, `000000740_weibull` = 5.0806, `000000741_weibull` = 3.13632, `000000742_weibull` = 0.158455, `000000743_weibull` = 4.19477, `000000744_weibull` = 2.23869, `000000745_weibull` = 13.7742, `000000746_weibull` = 24.2456, `000000747_weibull` = 6.70509, `000000748_weibull` = 20.3751, -`000000749_weibull` = 19.5283, `000000750_weibull` = 3.91329, `000000751_weibull` = 5.71811, `000000752_weibull` = 6.88565, `000000753_weibull` = 4.66092, `000000754_weibull` = 1.92255, `000000755_weibull` = 5.5892, `000000756_weibull` = 11.6164, `000000757_weibull` = 2.19398, `000000758_weibull` = 28.0191, `000000759_weibull` = 2.3076, `000000760_weibull` = 54.5906, `000000761_weibull` = 4.97811, `000000762_weibull` = 11.0474, `000000763_weibull` = 7.33782, `000000764_weibull` = 8.12598, `000000765_weibull` = 32.4012, -`000000766_weibull` = 4.90221, `000000767_weibull` = 2.56798, `000000768_weibull` = 5.59192, `000000769_weibull` = 7.48931, `000000770_weibull` = 29.9589, `000000771_weibull` = 1.14634, `000000772_weibull` = 19.8439, `000000773_weibull` = 21.1787, `000000774_weibull` = 35.9474, `000000775_weibull` = 6.95106, `000000776_weibull` = 24.3889, `000000777_weibull` = 1.03247, `000000778_weibull` = 41.2656, `000000779_weibull` = 12.6225, `000000780_weibull` = 6.46168, `000000781_weibull` = 8.87584, `000000782_weibull` = 5.13663, -`000000783_weibull` = 21.1031, `000000784_weibull` = 9.94355, `000000785_weibull` = 4.41562, `000000786_weibull` = 17.9, `000000787_weibull` = 3.30436, `000000788_weibull` = 11.1393, `000000789_weibull` = 2.84275, `000000790_weibull` = 4.9102, `000000791_weibull` = 11.9191, `000000792_weibull` = 38.1003, `000000793_weibull` = 6.80265, `000000794_weibull` = 11.485, `000000795_weibull` = 10.6183, `000000796_weibull` = 7.67177, `000000797_weibull` = 6.00574, `000000798_weibull` = 8.30243, `000000799_weibull` = 2.02478, -`000000800_weibull` = 10.4517, `000000801_weibull` = 14.6557, `000000802_weibull` = 16.3374, `000000803_weibull` = 7.4929, `000000804_weibull` = 43.4571, `000000805_weibull` = 42.9168, `000000806_weibull` = 3.16759, `000000807_weibull` = 0.475195, `000000808_weibull` = 6.81013, `000000809_weibull` = 1.83041, `000000810_weibull` = 12.1004, `000000811_weibull` = 22.3605, `000000812_weibull` = 5.54795, `000000813_weibull` = 1.53339, `000000814_weibull` = 55.6445, `000000815_weibull` = 15.8273, `000000816_weibull` = 2.37738, -`000000817_weibull` = 26.2269, `000000818_weibull` = 3.02347, `000000819_weibull` = 6.70646, `000000820_weibull` = 5.44767, `000000821_weibull` = 26.9121, `000000822_weibull` = 7.52595, `000000823_weibull` = 10.9506, `000000824_weibull` = 1.6473, `000000825_weibull` = 8.46459, `000000826_weibull` = 136.823, `000000827_weibull` = 87.7871, `000000828_weibull` = 2.61064, `000000829_weibull` = 10.731, `000000830_weibull` = 8.41267, `000000831_weibull` = 35.0284, `000000832_weibull` = 62.6396, `000000833_weibull` = 3.73152, -`000000834_weibull` = 8.99179, `000000835_weibull` = 33.6475, `000000836_weibull` = 5.20928, `000000837_weibull` = 1.64567, `000000838_weibull` = 4.90429, `000000839_weibull` = 1.82421, `000000840_weibull` = 14.2099, `000000841_weibull` = 3.64343, `000000842_weibull` = 9.84445, `000000843_weibull` = 0.965956, `000000844_weibull` = 1.86375, `000000845_weibull` = 6.46466, `000000846_weibull` = 0.951064, `000000847_weibull` = 9.31327, `000000848_weibull` = 10.8033, `000000849_weibull` = 2.47494, `000000850_weibull` = 19.8167, -`000000851_weibull` = 3.08379, `000000852_weibull` = 8.0285, `000000853_weibull` = 19.3035, `000000854_weibull` = 19.1566, `000000855_weibull` = 1.04571, `000000856_weibull` = 6.83929, `000000857_weibull` = 10.7827, `000000858_weibull` = 0.384606, `000000859_weibull` = 4.89905, `000000860_weibull` = 41.5776, `000000861_weibull` = 0.812629, `000000862_weibull` = 38.9555, `000000863_weibull` = 13.6787, `000000864_weibull` = 7.66852, `000000865_weibull` = 3.42344, `000000866_weibull` = 7.22798, `000000867_weibull` = 20.4959, -`000000868_weibull` = 12.6227, `000000869_weibull` = 7.19449, `000000870_weibull` = 5.95065, `000000871_weibull` = 3.27445, `000000872_weibull` = 6.7572, `000000873_weibull` = 17.8239, `000000874_weibull` = 9.41643, `000000875_weibull` = 6.61209, `000000876_weibull` = 3.03511, `000000877_weibull` = 5.24625, `000000878_weibull` = 12.2685, `000000879_weibull` = 5.67012, `000000880_weibull` = 19.4818, `000000881_weibull` = 11.717, `000000882_weibull` = 7.83834, `000000883_weibull` = 17.6322, `000000884_weibull` = 33.3085, -`000000885_weibull` = 10.58, `000000886_weibull` = 55.0352, `000000887_weibull` = 14.4672, `000000888_weibull` = 10.891, `000000889_weibull` = 22.9796, `000000890_weibull` = 19.3819, `000000891_weibull` = 14.7567, `000000892_weibull` = 2.08202, `000000893_weibull` = 10.2388, `000000894_weibull` = 4.25039, `000000895_weibull` = 3.90752, `000000896_weibull` = 3.93538, `000000897_weibull` = 69.7276, `000000898_weibull` = 0.569373, `000000899_weibull` = 5.44923, `000000900_weibull` = 5.63928, `000000901_weibull` = 16.4706, -`000000902_weibull` = 50.5643, `000000903_weibull` = 9.41545, `000000904_weibull` = 16.3014, `000000905_weibull` = 15.9052, `000000906_weibull` = 31.7436, `000000907_weibull` = 5.52527, `000000908_weibull` = 59.723, `000000909_weibull` = 3.81248, `000000910_weibull` = 8.92722, `000000911_weibull` = 4.78936, `000000912_weibull` = 5.35109, `000000913_weibull` = 13.055, `000000914_weibull` = 9.46156, `000000915_weibull` = 1.70864, `000000916_weibull` = 4.08273, `000000917_weibull` = 11.0212, `000000918_weibull` = 16.9752, -`000000919_weibull` = 66.8305, `000000920_weibull` = 0.751456, `000000921_weibull` = 24.1699, `000000922_weibull` = 31.7034, `000000923_weibull` = 9.07856, `000000924_weibull` = 23.0221, `000000925_weibull` = 95.737, `000000926_weibull` = 8.04703, `000000927_weibull` = 13.4366, `000000928_weibull` = 4.31304, `000000929_weibull` = 9.02947, `000000930_weibull` = 15.8079, `000000931_weibull` = 21.2501, `000000932_weibull` = 53.2942, `000000933_weibull` = 4.6176, `000000934_weibull` = 6.60944, `000000935_weibull` = 62.7774, -`000000936_weibull` = 29.8256, `000000937_weibull` = 4.84882, `000000938_weibull` = 2.10998, `000000939_weibull` = 4.99498, `000000940_weibull` = 21.7509, `000000941_weibull` = 26.2226, `000000942_weibull` = 2.36633, `000000943_weibull` = 6.09152, `000000944_weibull` = 1.85048, `000000945_weibull` = 3.01918, `000000946_weibull` = 14.4804, `000000947_weibull` = 11.9234, `000000948_weibull` = 7.71003, `000000949_weibull` = 17.0176, `000000950_weibull` = 6.94194, `000000951_weibull` = 18.9567, `000000952_weibull` = 15.7536, -`000000953_weibull` = 6.78262, `000000954_weibull` = 5.01591, `000000955_weibull` = 121.129, `000000956_weibull` = 4.19266, `000000957_weibull` = 9.48779, `000000958_weibull` = 3.38836, `000000959_weibull` = 16.2799, `000000960_weibull` = 1.23783, `000000961_weibull` = 57.8645, `000000962_weibull` = 9.68557, `000000963_weibull` = 7.04772, `000000964_weibull` = 11.714, `000000965_weibull` = 3.00731, `000000966_weibull` = 11.51, `000000967_weibull` = 18.793, `000000968_weibull` = 31.972, `000000969_weibull` = 12.9452, -`000000970_weibull` = 15.4942, `000000971_weibull` = 84.9538, `000000972_weibull` = 67.1684, `000000973_weibull` = 6.29336, `000000974_weibull` = 3.00836, `000000975_weibull` = 2.65631, `000000976_weibull` = 1.50941, `000000977_weibull` = 13.3284, `000000978_weibull` = 1.61057, `000000979_weibull` = 97.6822, `000000980_weibull` = 25.5453, `000000981_weibull` = 8.18775, `000000982_weibull` = 2.9778, `000000983_weibull` = 1.90584, `000000984_weibull` = 18.1971, `000000985_weibull` = 4.28652, `000000986_weibull` = 1.37614, -`000000987_weibull` = 6.40302, `000000988_weibull` = 57.4899, `000000989_weibull` = 1.69721, `000000990_weibull` = 12.7298, `000000991_weibull` = 6.16187, `000000992_weibull` = 5.70857, `000000993_weibull` = 39.0511, `000000994_weibull` = 19.4784, `000000995_weibull` = 44.2211, `000000996_weibull` = 12.2509, `000000997_weibull` = 1.34155, `000000998_weibull` = 4.94017, `000000999_weibull` = 6.35014, `000001000_weibull` = 117.203)" diff --git a/tests/testthat/test-glance.R b/tests/testthat/test-glance.R index 229fb1a4..d494259c 100644 --- a/tests/testthat/test-glance.R +++ b/tests/testthat/test-glance.R @@ -76,6 +76,26 @@ test_that("glance reweight same log_lik", { expect_equal(glance_weight$log_lik, glance$log_lik) }) +test_that("glance aicc is Inf when nobs < npars + 2", { + data <- data.frame(Conc = c(0.1, 0.3, 1, 3, 10)) + fit <- ssd_fit_dists(data, dists = c("lnorm", "lnorm_lnorm"), nrow = 5) + + glance <- glance(fit, wt = TRUE) + expect_identical(glance$nobs, c(5L, 5L)) + expect_true(is.finite(glance$aicc[glance$dist == "lnorm"])) + expect_identical(glance$aicc[glance$dist == "lnorm_lnorm"], Inf) + expect_identical(glance$wt[glance$dist == "lnorm_lnorm"], 0) +}) + +test_that("glance aicc finite when nobs >= npars + 2", { + data <- data.frame(Conc = c(0.1, 0.3, 1, 3, 10, 30, 100)) + fit <- ssd_fit_dists(data, dists = c("lnorm", "lnorm_lnorm")) + + glance <- glance(fit, wt = TRUE) + expect_identical(glance$nobs, c(7L, 7L)) + expect_true(all(is.finite(glance$aicc))) +}) + test_that("glance reweight same log_lik", { data <- ssddata::ccme_boron data$Upper <- data$Conc diff --git a/tests/testthat/test-hc.R b/tests/testthat/test-hc.R index 1633bdff..893e8d49 100644 --- a/tests/testthat/test-hc.R +++ b/tests/testthat/test-hc.R @@ -1229,3 +1229,14 @@ test_that("ssd_hc fitdists arithmetic_samples ci", { expect_s3_class(hc, "tbl_df") expect_snapshot_data(hc, "hc_arithmetic_samples") }) + +test_that("hc duplicate proportion values return one row per input value in order", { + fits <- ssd_fit_dists(ssddata::ccme_boron) + + hc <- ssd_hc(fits, proportion = c(0.05, 0.1, 0.2)) + hc_dup <- ssd_hc(fits, proportion = c(0.05, 0.1, 0.2, 0.05)) + + expect_identical(nrow(hc_dup), 4L) + expect_identical(hc_dup$proportion, c(0.05, 0.1, 0.2, 0.05)) + expect_equal(hc_dup$est, c(hc$est, hc$est[1])) +}) diff --git a/tests/testthat/test-hp.R b/tests/testthat/test-hp.R index a2e3c3ed..34d34888 100644 --- a/tests/testthat/test-hp.R +++ b/tests/testthat/test-hp.R @@ -457,44 +457,6 @@ test_that("ssd_hp effect with higher weight two distributions", { expect_snapshot_value(hp_10$se, style = "deparse") }) -test_that("ssd_hp cis with non-convergence", { - withr::with_seed(99, { - conc <- ssd_rlnorm_lnorm( - 100, - meanlog1 = 0, - meanlog2 = 1, - sdlog1 = 1 / 10, - sdlog2 = 1 / 10, - pmix = 0.2 - ) - data <- data.frame(Conc = conc) - fit <- ssd_fit_dists(data, dists = "lnorm_lnorm", min_pmix = 0.15) - expect_identical(attr(fit, "min_pmix"), 0.15) - hp15 <- ssd_hp( - fit, - conc = 1, - ci = TRUE, - nboot = 100, - min_pboot = 0.9, - proportion = FALSE - ) - attr(fit, "min_pmix") <- 0.3 - expect_identical(attr(fit, "min_pmix"), 0.3) - hp30 <- ssd_hp( - fit, - conc = 1, - ci = TRUE, - nboot = 100, - min_pboot = 0.9, - ci_method = "MACL", - samples = TRUE, - proportion = FALSE - ) - }) - expect_s3_class(hp30, "tbl") - expect_snapshot_data(hp30, "hp_30") -}) - test_that("ssd_hp with 1 bootstrap", { fit <- ssd_fit_dists(ssddata::ccme_boron, dists = "lnorm") withr::with_seed(10, { @@ -511,34 +473,6 @@ test_that("ssd_hp with 1 bootstrap", { expect_snapshot_data(hp, "hp_1") }) -test_that("ssd_hp fix_weight", { - fits <- ssd_fit_dists(ssddata::ccme_boron, dists = c("lnorm", "lgumbel")) - - withr::with_seed(102, { - hc_unfix <- ssd_hp( - fits, - nboot = 100, - ci = TRUE, - ci_method = "multi_free", - samples = TRUE, - proportion = FALSE - ) - }) - expect_snapshot_data(hc_unfix, "hc_unfix") - - withr::with_seed(102, { - hc_fix <- ssd_hp( - fits, - nboot = 100, - ci = TRUE, - ci_method = "multi_fixed", - samples = TRUE, - proportion = FALSE - ) - }) - expect_snapshot_data(hc_fix, "hc_fix") -}) - test_that("hp multis match", { fits <- ssd_fit_dists(ssddata::ccme_boron, dists = c("lnorm", "gamma")) withr::with_seed(102, { @@ -659,6 +593,25 @@ test_that("hp est_method = FALSE deprecated and overrides est_method", { expect_identical(false, arithmetic) }) +test_that("hp duplicate conc values return one row per input value in order", { + fits <- ssd_fit_dists(ssddata::ccme_boron) + + hp <- ssd_hp(fits, conc = c(1, 10, 20), proportion = TRUE) + hp_dup <- ssd_hp(fits, conc = c(1, 10, 20, 1), proportion = TRUE) + + expect_identical(nrow(hp_dup), 4L) + expect_identical(hp_dup$conc, c(1, 10, 20, 1)) + expect_equal(hp_dup$est, c(hp$est, hp$est[1])) +}) + +test_that("hp duplicate conc values unaffected when average = FALSE", { + fits <- ssd_fit_dists(ssddata::ccme_boron) + + hp <- ssd_hp(fits, conc = c(1, 10, 1), average = FALSE, proportion = TRUE) + expect_identical(nrow(hp), 18L) + expect_identical(unique(hp$conc), c(1, 10)) +}) + test_that("hp ci_method = 'weighted_arithmetic' deprecated for MACL", { fits <- ssd_fit_dists(ssddata::ccme_boron) withr::with_seed(10, { diff --git a/tests/testthat/test-weibull.R b/tests/testthat/test-weibull.R index 9856da5a..b6c50461 100644 --- a/tests/testthat/test-weibull.R +++ b/tests/testthat/test-weibull.R @@ -48,17 +48,3 @@ test_that("weibull works anon_e", { tidy <- tidy(fit) expect_snapshot_data(tidy, "tidy_anon_e") }) - -test_that("weibull bootstraps anona", { - fit <- ssd_fit_dists(ssddata::anon_a, dists = "weibull") - withr::with_seed(50, { - hc <- ssd_hc( - fit, - nboot = 1000, - ci = TRUE, - ci_method = "weighted_samples", - samples = TRUE - ) - }) - expect_snapshot_data(hc, "hc_anona") -}) diff --git a/vignettes/faqs.Rmd b/vignettes/faqs.Rmd index 7fae033a..9f56337f 100644 --- a/vignettes/faqs.Rmd +++ b/vignettes/faqs.Rmd @@ -32,7 +32,7 @@ ssd_plot_cdf(dist, average = NA) ### How can I include mathematical expressions in the x-axis label when using `ssd_plot()`? -```{r, message = FALSE, fig.alt = "A plot showing the model averaged fit with a mathematical expression in the xlabel with the units."} +```{r, message = FALSE, eval = requireNamespace("latex2exp", quietly = TRUE), fig.alt = "A plot showing the model averaged fit with a mathematical expression in the xlabel with the units."} library(ssdtools) ssd_plot(ssddata::ccme_boron, ssdtools::boron_pred, label = "Species", shape = "Group") +