giabaio / BCEA

Bayesian Cost Effectiveness Analysis. Given the results of a Bayesian model (possibly based on MCMC) in the form of simulations from the posterior distributions of suitable variables of costs and clinical benefits for two or more interventions, produces a health economic evaluation. Compares one of the interventions (the "reference") to the others ("comparators"). Produces many summary and plots to analyse the results
https://gianluca.statistica.it/software/bcea/
GNU General Public License v3.0
40 stars 16 forks source link

major rewrite of bcea() and ceac.plot() #21

Closed n8thangreen closed 4 years ago

n8thangreen commented 4 years ago

I'm not sure why theres a merge conflict without looking in to it because I thought I forked the latest version but you'll know better than me.

There are a lot of changes, both large and small.

This certainly needs a good code review. Realistically, I think it could take a bit of time to do this properly. Outstanding things to do are:

giabaio commented 4 years ago

Thank you! I've merged the pull request --- I had changed the README file to update the INLA repo...

I think all done --- I'll start getting some tests in. Can I tell the people who requested the changes they have been implemented in this version, then? G

On Tue, 21 Jul 2020 at 15:06, Dr Nathan Green notifications@github.com wrote:

I'm not sure why theres a merge conflict without looking in to it because I thought I forked the latest version but you'll know better than me.

There are a lot of changes, both large and small.

  • Most simply, there are style changes, such as using more line breaks and spaces
  • I've split lots of the longer functions in to smaller subfunctions, notably bcea() and ceac.plot()
  • I've tried to organise things together so version comments are in NEWS, data Rmd in data.R, options() stuff in onLoad() in zzz.R, etc

This certainly needs a good code review. Realistically, I think it could take a bit of time to do this properly. Outstanding things to do are:

  • Finish rewriting ceplane() in the same way as ceac.plot(). At the moment its just commented out
  • Write all the tests of the bcea() subfunctions, and test for everything else too. The plots can use the vdiffr package.
  • Other things in Issues

You can view, comment on, or merge this pull request online at:

https://github.com/giabaio/BCEA/pull/21 Commit Summary

  • comment with ideas to refactor and test bcea()
  • start abstracting out bcea() into sub-functions
  • some more TODO commments
  • some error tests
  • now passes all error tests

  • more basic tests
  • compute incremental function complete and tested
  • delete old code in bcea()
  • compute_CEAC()
  • outlines all the bcea subfunctions. need to finish evpi ones and write tests
  • finished writing functions and seems to work ok.
  • a bit of commenting
  • created constructor and helper for bcea()
  • fixed all tests
  • dont export helper functions
  • Kmax exist seems superfluous so deleted
  • fix step value
  • tidy stop()s
  • starting to edit graphing functions and their documentation. Basic rearranging and low handing fruit.
  • some more tidying and extracting out plotting functions.
  • ceac.plot refactoring. doesnt run yet
  • using lists and modifylist() to simplify ceac.plot
  • ggplot cec.plot version works for one comparitor. Finishing for > 1.
  • sort out elipsis to ceac.plot ggplot eg line colour, title
  • finish ceac.plot for ggplot dispatch. need to add tests.
  • createInputs() simple refactoring
  • write own theme ceac function
  • Merge pull request #1 from n8thangreen/plots
  • include a ggplot test using vdiffr
  • finished ceac.plot_base(). need to add tests. its still a bit messy but much better than before
  • refactored sim.table()
  • finished sim.table() refactor
  • createInputs() as S3 object
  • first attempt to tidy and organise evppi functions. Lots of work to do with all of the conditional statements.
  • added a NEWS doc. Needs to be filled in for latest release.
  • frame ceplane.plot to refactor as ceac.plot
  • dispatch ceac.plot on whether multiple comparisons. Pulled ceac.multi() apart into smaller functions similar to ceac.plot but haven't finished
  • a lot of refactoring (and breaking the code!)
  • finished resstructuring and mostly morking ceac plots.
  • file name change
  • typo
  • finished base ceac rewrite and written vignette. need to finish ggplot ceac for pairwise
  • refactor diag.evppi()
  • bit more diag.evppi refactoring
  • bug fix:
  • update README and add MIT licence
  • update NEWS and documentation
  • fix: document build
  • finished dispatch ceaec_plot_ggplot with ce.multi
  • delete deprecated ceac_multi_ggplot
  • move options(scipen=...) into .onLoad()
  • test newline
  • Merge pull request #8 from n8thangreen/plots
  • Change license to GPL
  • Merge pull request #11 from n8thangreen/plots
  • update data docs
  • Merge pull request #12 from n8thangreen/plots

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/giabaio/BCEA/pull/21, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSOVVUU3VVZR3GPAVDTR4WOFRANCNFSM4PDUJHQA .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Fax +44 (0)20 7383 4703 Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http:www.statistica.it/gianluca/blog

https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.co.uk/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio https://orcid.org/0000-0003-4314-2570

DUE TO THE COVID-19 EMERGENCY, I WILL PROBABLY HAVE ERRATIC WORKING HOURS IN THE NEXT FEW DAYS/WEEKS/MONTHS/YEARS. I MAY BE SLOWER IN REPLYING TO EMAILS OR SEND THEM AT UNGODLY HOURS. PLEASE BEAR WITH ME.

n8thangreen commented 4 years ago

I think so. An if it needs slight changes it should be easy from now on.

giabaio commented 4 years ago

Perfect---thank you. I'll give it a couple of days and then when I have a moment, I'll write a blog post and update people (who asked for the changes in the first place...).

On Tue, 21 Jul 2020 at 18:21, Dr Nathan Green notifications@github.com wrote:

I think so. An if it needs slight changes it should be easy from now on.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/giabaio/BCEA/pull/21#issuecomment-661994970, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACCRVSOIO46CZHRSU365RK3R4XFANANCNFSM4PDUJHQA .

--

Gianluca Baio

Professor of Statistics & Health Economics Department of Statistical Science University College London 1-19 Torrington Place, London WC1E 6BT, UK Telephone +44(0)20 7679 1248 (internal: 41248) Fax +44 (0)20 7383 4703 Website: http://www.homepages.ucl.ac.uk/~ucakgba http://www.homepages.ucl.ac.uk/~ucakgba/ Blog: http:www.statistica.it/gianluca/blog

https://twitter.com/gianlubaio https://www.linkedin.com/in/gianluca-baio-b893879/ https://github.com/giabaio https://scholar.google.co.uk/citations?user=ro0QvGsAAAAJ&hl=en https://www.researchgate.net/profile/Gianluca_Baio https://orcid.org/0000-0003-4314-2570

DUE TO THE COVID-19 EMERGENCY, I WILL PROBABLY HAVE ERRATIC WORKING HOURS IN THE NEXT FEW DAYS/WEEKS/MONTHS/YEARS. I MAY BE SLOWER IN REPLYING TO EMAILS OR SEND THEM AT UNGODLY HOURS. PLEASE BEAR WITH ME.