Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing suite for PoolPrev and HierPoolPrev #26

Open
caitlinch opened this issue Nov 26, 2024 · 3 comments
Open

Testing suite for PoolPrev and HierPoolPrev #26

caitlinch opened this issue Nov 26, 2024 · 3 comments
Labels

Comments

@caitlinch
Copy link
Collaborator

Develop testing for PoolPrev() and HierPoolPrev(), including checking input data structure and format.

@caitlinch caitlinch self-assigned this Nov 26, 2024
@caitlinch
Copy link
Collaborator Author

Implemented tests for input data frame in tests/testthat/test-input_checks.R:

  • Warnings:
    • Check whether empty rows are present
    • Check whether rows containing only NA are present
    • Check whether rows have one or more missing value
  • Errors:
    • Check that the result column is present
    • Check that the poolSize column is present
    • Check that results column values are numeric or integer
    • Check that poolSize column values are numeric or integer
    • Check that result column contains only 0 and 1

@caitlinch
Copy link
Collaborator Author

Completed checks:

  • HierPoolPrev() raises no errors for trimmed SimpleExampleData
  • PoolPrev() returns correct ML point estimate for SimpleExampleData
  • PoolPrev() returns correct ML and Bayesian estimates for SimpleExampleData

@caitlinch caitlinch removed their assignment Dec 16, 2024
@caitlinch
Copy link
Collaborator Author

caitlinch commented Dec 16, 2024

To do:

  1. Add tests for bad data input in PoolPrev(), HierPoolPrev()
  2. Correct test for HierPoolPrev() to handle errors within the statistical modelling section. The current test for HierPoolPrev() sometimes fails with the following message:
  Expected `expect_no_warning(...)` to run without any errors.
  i Actually got a <expectation_failure> with text:
      Expected `HierPoolPrev(...)` to run without any warnings.
  i Actually got a <simpleWarning> with text:
    There were 8 divergent transitions after warmup. 
    See https://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup
    to find out why this is a problem and how to eliminate them.

This test needs to be updated to check for PoolTestR errors only (if divergent transitions occur, the test should still pass).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant