insightsengineering / tern

Table, Listings, and Graphs (TLG) library for common outputs used in clinical trials
https://insightsengineering.github.io/tern/
Other
77 stars 22 forks source link

Investigate variable printout for`summarize_glm_count` #1058

Open Melkiades opened 1 year ago

Melkiades commented 1 year ago
✖ | 3      25 | summarize_glm_count [1.4s]                                      
  ────────────────────────────────────────────────────────────────────────────────
  Failure ('test-summarize_glm_count.R:185:3'): h_ppmeans works with healthy input
  Snapshot of code has changed:
  old vs new
    Code
      res
    Output
  -                  rate asymp.LCL asymp.UCL            ARM
  +                      rate asymp.LCL asymp.UCL            ARM
  -   A: Drug X      3.07  2.202774  4.278651      A: Drug X
  +   A: Drug X      9.029759  6.295928  12.95068      A: Drug X
  -   B: Placebo     3.07  2.202774  4.278651     B: Placebo
  +   B: Placebo     9.029759  6.295928  12.95068     B: Placebo
  -   C: Combination 3.07  2.202774  4.278651 C: Combination
  +   C: Combination 9.029759  6.295928  12.95068 C: Combination

  * Run `testthat::snapshot_accept('summarize_glm_count')` to accept the change.
  * Run `testthat::snapshot_review('summarize_glm_count')` to interactively review the change.

  Failure ('test-summarize_glm_count.R:206:3'): s_glm_count works with healthy input
  Snapshot of code has changed:
       old                     | new                           
   [5]   [1] 73                |   [1] 73                  [5] 
   [6]                         |                           [6] 
   [7]   $rate                 |   $rate                   [7] 
   [8]   [1] 3.486005          -   [1] 10.20612            [8] 
   [9]   attr(,"label")        |   attr(,"label")          [9] 
  [10]   [1] "Adjusted Rate"   |   [1] "Adjusted Rate"     [10]
  [11]                         |                           [11]
  [12]   $rate_ci              |   $rate_ci                [12]
  [13]   [1] 1.983340 6.127155 -   [1]  5.627535 18.509855 [13]
  [14]   attr(,"label")        |   attr(,"label")          [14]
  [15]   [1] "95% CI"          |   [1] "95% CI"            [15]
  [16]                         |                           [16]

  * Run `testthat::snapshot_accept('summarize_glm_count')` to accept the change.
  * Run `testthat::snapshot_review('summarize_glm_count')` to interactively review the change.

  Failure ('test-summarize_glm_count.R:229:3'): s_glm_count works with no reference group selected.
  Snapshot of code has changed:
       old                     | new                           
   [5]   [1] 73                |   [1] 73                  [5] 
   [6]                         |                           [6] 
   [7]   $rate                 |   $rate                   [7] 
   [8]   [1] 3.486005          -   [1] 10.20612            [8] 
   [9]   attr(,"label")        |   attr(,"label")          [9] 
  [10]   [1] "Adjusted Rate"   |   [1] "Adjusted Rate"     [10]
  [11]                         |                           [11]
  [12]   $rate_ci              |   $rate_ci                [12]
  [13]   [1] 1.983340 6.127155 -   [1]  5.627535 18.509855 [13]
  [14]   attr(,"label")        |   attr(,"label")          [14]
  [15]   [1] "95% CI"          |   [1] "95% CI"            [15]
  [16]                         |                           [16]

  * Run `testthat::snapshot_accept('summarize_glm_count')` to accept the change.
  * Run `testthat::snapshot_review('summarize_glm_count')` to interactively review the change.
edelarua commented 11 months ago

Note that for RATET01 which uses summarize_glm_count in scda.test integration test results differ for the same table. Validated integration tests expect the "wrong" values (current snapshot values), while the non-validated integration tests expect the output that I obtain by running the test on my PC.

edelarua commented 1 month ago

See also the printout in tests of h_glm_count(distribution = "poisson") which now result in variable SE values as well.

Melkiades commented 1 month ago

See also the printout in tests of h_glm_count(distribution = "poisson") which now result in variable SE values as well.

Oh no it is spreading!!! Ahah I am fine with silencing these for now. We should flag this in the docs though (very clearly)

edelarua commented 1 month ago

Oh no it is spreading!!! Ahah I am fine with silencing these for now. We should flag this in the docs though (very clearly)

Yes, it could be a one time change in emmeans, but better to isolate the issue for now and document it for users.