class: title-slide # Working with the R package BCEA ## Gianluca Baio ### [Department of Statistical Science](https://www.ucl.ac.uk/statistics/) | University College London .title-small[ <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#00acee;height:0.8em;"> [ comment ] <path d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path></svg> [g.baio@ucl.ac.uk](mailto:g.baio@ucl.ac.uk) <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#EA7600;height:0.8em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path></svg> [http://www.statistica.it/gianluca/](http://www.statistica.it/gianluca/) <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#EA7600;height:0.8em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path></svg> [https://egon.stats.ucl.ac.uk/research/statistics-health-economics/](https://egon.stats.ucl.ac.uk/research/statistics-health-economics/) <svg viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:black;height:0.8em;"> [ comment ] <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> [https://github.com/giabaio](https://github.com/giabaio) <svg viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:black;height:0.8em;"> [ comment ] <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> [https://github.com/StatisticsHealthEconomics](https://github.com/StatisticsHealthEconomics) <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#00acee;height:0.8em;"> [ comment ] <path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path></svg> [@gianlubaio](https://twitter.com/gianlubaio) ] ### ISPOR Short courses, Internetville <!-- Can also separate the various components of the extra argument 'params', eg as in ### ISPOR Short courses, Internetville, HTA and BCEA --> 17 June 2021 <!-- This adds a footer (optional and with other possibilities...) --> .footer-left[ <span><a href="http://www.statistica.it/gianluca/"><img src="assets/logo.png" title="Go home" width="2.0%"></a></span> <span style="position: relative; bottom: 5px; color: #D5D5D5;"> © Gianluca Baio (UCL)</span> ] --- layout: true .footer-left[ <span><a href="http://www.statistica.it/gianluca/"><img src="assets/logo.png" title="Go home" width="2.0%"></a></span> <span style="position: relative; bottom: 5px; color: #D5D5D5;"> © Gianluca Baio (UCL)</span> ] <!-- Can also include social media icons & hyperlinks --> .footer-social[ <a href="https://twitter.com/giabaio"; title="Follow me on Twitter"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#bcc0c4;height:0.8em;bottom:1em;"> [ comment ] <path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"></path> </svg></a> <a href="mailto:g.baio@ucl.ac.uk"; title="Email me"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#bcc0c4;height:0.8em;"> [ comment ] <path d="M502.3 190.8c3.9-3.1 9.7-.2 9.7 4.7V400c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V195.6c0-5 5.7-7.8 9.7-4.7 22.4 17.4 52.1 39.5 154.1 113.6 21.1 15.4 56.7 47.8 92.2 47.6 35.7.3 72-32.8 92.3-47.6 102-74.1 131.6-96.3 154-113.7zM256 320c23.2.4 56.6-29.2 73.4-41.4 132.7-96.3 142.8-104.7 173.4-128.7 5.8-4.5 9.2-11.5 9.2-18.9v-19c0-26.5-21.5-48-48-48H48C21.5 64 0 85.5 0 112v19c0 7.4 3.4 14.3 9.2 18.9 30.6 23.9 40.7 32.4 173.4 128.7 16.8 12.2 50.2 41.8 73.4 41.4z"></path> </svg></a> <a href="http://www.statistica.it/gianluca"; title="Visit my website"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:#bcc0c4;height:0.8em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path> </svg></a> ] <!-- Can also add a center footer, eg to include the title of the talk --> .footer-center[ HTA and BCEA ] <!-- And a right footer, to include the date --> .footer-right[ ISPOR Short courses, 17 Jun 2021 ] --- # `BCEA` ## An `R` package for (Bayesian) cost-effectiveness analysis ### What is `BCEA` not? - `BCEA` is **not** a package to automatically run a Bayesian analysis - It cannot build the health economic model for you - It does not prepare the data to be used in the model - It does not automatically run the MCMC simulations - It does not choose the prior distributions for you -- ### So what *is* it then? - `BCEA` provides a set of specific functions to systematically post-process the output of a Bayesian health economic model - Uses `R` [http://cran.r-project.org/](http://cran.r-project.org/) - Very good at interacting with standard MCMC software - `BUGS`: [www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml](www.mrc-bsu.cam.ac.uk/bugs/winbugs/contents.shtml) - `JAGS`: [www.mcmc-jags.sourceforge.net/](www.mcmc-jags.sourceforge.net/) - `rstan`: [https://mc-stan.org/users/interfaces/rstan](https://mc-stan.org/users/interfaces/rstan) - .red[**Free**] and there is a very large community of contributors - Specifically designed for statistical analysis and has very good graphical capabilities --- # `BCEA` ## A `R` package for (Bayesian) cost-effectiveness analysis ### `BCEA` and its use directly in `R` are designed with these objectives in mind 1. Checking the model assumptions - Do we mean what we mean (eg in terms of PSA simulations)?... - Simulation error (especially, **but not only**, for a Bayesian approach) -- 2. Produce the base-case economic evaluation - What’s the most cost-effective intervention, given current evidence? - Cost-effectiveness plane, Expected Incremental Benefit (as a function of `\(k\)`),... -- 3. Perform uncertainty analysis - Standard PSA (mandatory): Cost-effectiveness Plane, CEAC, ... - Fairly easy (but not always used): CEAF - More advanced/"too difficult" (rarely used): EVP(P)I/EVSI -- 4. Standardised reporting - Graphical tools (use **excellent** `R` facilities) --- count: false # `BCEA` ## An `R` package for (Bayesian) cost-effectiveness analysis <center><img src=./img/bcea_scheme-1.png width='65%' title=''></center> <span style="display:block; margin-top: -50px ;"></span> .small[ <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path></svg> [www.statistica.it/gianluca/BCEA](www.statistica.it/gianluca/BCEA) <svg viewBox="0 0 496 512" xmlns="http://www.w3.org/2000/svg" style="position:relative;display:inline-block;top:.1em;fill:black;height:0.8em;"> [ comment ] <path d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"></path></svg> [https://github.com/giabaio/BCEA](https://github.com/giabaio/BCEA) ] --- class: empty-slide .huge[Part I] # Using `BCEA` to summarise outputs of an economic model --- # How does `BCEA` work? .panelset[ .panel[ .panel-name[Installation] - `BCEA` is available from [CRAN](https://cran.r-project.org/) - Current *stable* version: 2.3-1.1 (26 August 2019) - But it is also under constant development in the [GitHub repository](https://github.com/giabaio/BCEA) - Current *stable* version: 2.3-2 (30 January 2020) - Current *development* version: 2.4-1 (5 February 2021) – **major** update (soon to be released!) ```r # Install BCEA (only required once and needs an internet connection!). # You can either get the "official" version from CRAN install.packages("BCEA") # Or the development version from the GitHub repository devtools::install_github("giabaio/BCEA") # stable version (2.3-2) devtools::install_github("giabaio/BCEA",ref="devel") # development version (2.4-1) ``` <span style="display:block; margin-top: 30px ;"></span> NB: The beauty of the GitHub version is that it can be updated on the fly and be immediately available for users! ] .panel[ .panel-name[Using BCEA] ```r library(dplyr) # (Not necessary - helpful for data manipulation!) library(BCEA) # Then loads the package (so you can access its functions) data(Vaccine) # Loads an example dataset ``` <span style="display:block; margin-top: 40px ;"></span> - The "Vaccine" example is a fictional cost-effectiveness model for and influenza vaccine, based on evidence synthesis (and a real case) - 2 treatment options ("Standard of care" vs "Vaccination") and overall 63 parameters - Discussed in details in <svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"></path></svg> [Baio et al, 2017](http://www.statistica.it/gianluca/book/bcea/) and <svg viewBox="0 0 384 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> <g label="icon" id="layer6" groupmode="layer"> <path id="path2" d="M 120.19265,177.73779 C 123.18778,77.35076 64.277527,63.999998 64.277527,63.999998 v 31.26245 C 40.834519,83.611374 18.32863,81.929634 18.32863,81.929634 V 337.10903 c 0,0 98.10414,-11.41744 98.10414,84.40952 0,0 36.58424,-153.37442 248.86103,26.48145 0,-61.59342 0.37757,-216.93925 0.37757,-268.28471 C 169.9561,37.131382 120.1931,177.73779 120.1931,177.73779 Z m 187.20631,173.82056 -12.37599,-97.65441 h -0.448 l -40.72819,97.65441 h -17.55994 l -38.9362,-97.65441 h -0.448 l -14.17589,97.65441 h -43.87514 l 28.8015,-169.61925 h 43.42716 l 34.43518,90.6496 36.46566,-90.6496 h 43.87513 l 25.6817,169.61925 h -44.13938 z" style="stroke-width:0.0675239"></path> </g></svg> [Baio and Dawid, 2011](https://pubmed.ncbi.nlm.nih.gov/21930515/) - In this case, PSA simulations obtained from a full Bayesian model, but could be done in a spreadsheet and imported into `R` ] .panel[ .panel-name[Show. Me. The. Data] <span style="display:block; margin-top: -10px ;"></span> ```r # Creates a matrix with the underlying model simulations inp = CreateInputs(vaccine, `print.lincom=FALSE`) `# NB: this option will be slightly different in 2.4-1!` # Visualise the output inp$mat `%>% as_tibble()` `# "piping" ('%>%') and formatting nicely` ``` ``` # A tibble: 1,000 x 56 Adverse.events Death.1.1. Death.2.1. Death.2.2. GP.1.1. GP.2.1. GP.2.2. Hospital.1.1. Hospital.2.1. Hospital.2.2. Infected.1.1. Infected.2.1. Infected.2.2. Mild.Compl.1.1. Mild.Compl.2.1. Mild.Compl.2.2. Pneumonia.1.1. Pneumonia.2.1. Pneumonia.2.2. Trt.1.1.1. Trt.2.1.1. Trt.1.2.1. Trt.2.2.1. <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> 1 1466 1 0 0 1664 958 230 0 1 0 5992 3401 876 691 405 102 18 15 5 714 565 411 330 2 5329 1 1 0 1414 748 276 0 0 1 7471 4024 1536 570 308 112 12 15 3 588 463 322 255 3 5203 1 1 0 809 489 80 0 0 0 6718 4300 788 332 214 40 10 2 4 345 266 211 174 4 2351 2 0 0 1761 1157 261 1 0 0 4837 3269 702 739 479 109 19 17 5 735 609 505 395 5 8303 1 2 0 2472 964 432 1 1 0 4749 1894 846 1049 425 177 25 11 2 1048 838 427 337 6 3607 1 1 0 2224 1342 260 1 0 0 4938 2976 596 915 560 100 35 21 2 962 720 575 455 7 6304 4 1 1 3478 1107 591 2 1 0 11080 3547 2045 1505 482 247 66 19 10 1437 1258 449 388 8 4337 1 1 1 1483 799 189 0 0 0 3867 2164 525 622 333 65 22 7 3 630 501 351 259 9 5482 0 0 0 1587 798 279 0 0 0 5163 2532 910 675 332 115 25 11 4 697 535 338 269 10 3125 2 2 0 2578 1681 243 0 0 0 7265 4766 700 1063 711 102 41 17 3 1082 864 699 577 # … with 990 more rows, and 33 more variables: Trt.1.2.2. <dbl>, Trt.2.2.2. <dbl>, beta.1. <dbl>, beta.2. <dbl>, beta.3. <dbl>, beta.4. <dbl>, beta.5. <dbl>, beta.6. <dbl>, beta.7. <dbl>, delta <dbl>, eta <dbl>, gamma.1. <dbl>, gamma.2. <dbl>, lambda <dbl>, n.1.2. <dbl>, n.2.2. <dbl>, phi <dbl>, # pi.1.2. <dbl>, psi.1. <dbl>, psi.2. <dbl>, psi.3. <dbl>, psi.4. <dbl>, psi.5. <dbl>, psi.6. <dbl>, psi.7. <dbl>, psi.8. <dbl>, q.1. <dbl>, q.4. <dbl>, q.5. <dbl>, q.6. <dbl>, q.7. <dbl>, rho.2. <dbl>, xi <dbl> ``` ] .panel[ .panel-name[Economic model] ```r # Defines the number of simulations considered n.sims=`inp$mat %>% nrow()` `# applies the function 'nrow' (number of rows) to the object 'inp$mat'` `# NB: in R 4.1.0, can also use 'native' pipe ('|>')` `# (probably a bit quicker, but in most cases, may be immaterial...)` # Aggregates the model inputs to compute (e,c) QALYs.inf = QALYs.pne <- QALYs.hosp <- QALYs.adv <- QALYs.death <- matrix(0,n.sims,2) for (t in 1:2) { QALYs.inf[,t] = ((Infected[,t,1] + Infected[,t,2])*omega[,1]/365)/N QALYs.pne[,t] = ((Pneumonia[,t,1] + Pneumonia[,t,2])*omega[,4]/365)/N QALYs.hosp[,t] = ((Hospital[,t,1] + Hospital[,t,2])*omega[,5]/365)/N QALYs.death[,t] = ((Death[,t,1] + Death[,t,2])*omega[,6])/N } QALYs.adv[,2] = (Adverse.events*omega[,7]/365)/N e = -(QALYs.inf + QALYs.pne + QALYs.adv + QALYs.hosp + QALYs.death) + ... ``` <span style="display:block; margin-top: 40px ;"></span> - NB: The data stored in the `Vaccine` object (built-in in `BCEA`) already contains the objects `e,c` that can be used to run the decision analysis... - So, this step is actually not needed (but documented in <svg viewBox="0 0 576 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M542.22 32.05c-54.8 3.11-163.72 14.43-230.96 55.59-4.64 2.84-7.27 7.89-7.27 13.17v363.87c0 11.55 12.63 18.85 23.28 13.49 69.18-34.82 169.23-44.32 218.7-46.92 16.89-.89 30.02-14.43 30.02-30.66V62.75c.01-17.71-15.35-31.74-33.77-30.7zM264.73 87.64C197.5 46.48 88.58 35.17 33.78 32.05 15.36 31.01 0 45.04 0 62.75V400.6c0 16.24 13.13 29.78 30.02 30.66 49.49 2.6 149.59 12.11 218.77 46.95 10.62 5.35 23.21-1.94 23.21-13.46V100.63c0-5.29-2.62-10.14-7.27-12.99z"></path></svg> [Baio et al, 2017](http://www.statistica.it/gianluca/book/bcea/)) ] .panel[ .panel-name[Cost & effects] ```r cbind(e,c) %>% as_tibble(`.name_repair="universal"`) `# ensures that the columns are named` ``` ``` # A tibble: 1,000 x 4 Status.Quo...1 Vaccination...2 Status.Quo...3 Vaccination...4 <dbl> <dbl> <dbl> <dbl> 1 -0.00105 -0.000899 10.4 16.3 2 -0.000884 -0.000732 5.83 9.37 3 -0.000890 -0.000698 5.78 15.9 4 -0.00164 -0.00114 12.2 18.7 5 -0.00135 -0.000957 9.79 16.5 6 -0.00143 -0.000936 6.56 9.69 7 -0.000960 -0.00105 8.45 11.3 8 -0.00181 -0.00139 6.76 9.99 9 -0.000842 -0.000556 3.60 10.1 10 -0.00168 -0.00105 4.09 11.0 # … with 990 more rows ``` <span style="display:block; margin-top: 40px ;"></span> - These calculations *can* be done also in a spreadsheet (nothing more than algebra, **once you have the simulations**) ] ] --- count: false # How does `BCEA` work? - At this point, we are ready to call the function `bcea` that runs the economic analysis, for example something like ```r treats = c("Status quo","Vaccination") m = bcea(e=e,c=c,ref=2,interventions=treats,Kmax=50000) ``` - The inputs to the function are - `e`: a **matrix** containing the simulations for the clinical benefits (that is `\(n_{\rm{sim}}\times n_{\rm{int}}\)` values) - `c`: a **matrix** containing the simulations for the costs (that is `\(n_{\rm{sim}}\times n_{\rm{int}}\)` values) - `ref`: an indication of which intervention is to be taken as reference (default: the intervention in the first column of `e` or `c`) - `interventions`: a vector of labels for the interventions being compared - `Kmax`: the maximum value of `\(k\)`, the parameter of willingness to pay -- - The output is an object `m` containing several elements ```r names(m) ``` ``` [1] "n.sim" "n.comparators" "n.comparisons" "delta.e" "delta.c" "ICER" "Kmax" "k" "ceac" "ib" "eib" "kstar" "best" "U" "vi" "Ustar" "ol" "evi" [19] "interventions" "ref" "comp" "step" "e" "c" ``` --- count: false # How does `BCEA` work? Can visualise the output in various formats (tables/graphs) ```r # The 'summary' "method" produces a tabular output summary(m) ``` ``` Cost-effectiveness analysis summary Reference intervention: Vaccination Comparator intervention: Status quo Optimal decision: choose Status quo for k<20100 and Vaccination for k>=20100 Analysis for willingness to pay parameter k = 25000 Expected utility Status quo -36.054 Vaccination -34.826 EIB CEAC ICER Vaccination vs Status quo 1.2284 0.529 20098 Optimal intervention (max expected utility) for k=25000: Vaccination EVPI 2.4145 ``` --- count: false # How does `BCEA` work? Can visualise the output in various formats (tables/graphs) ```r # The 'plot' "method" produces a *specific* version of graphical output plot(m) ``` <img src="./img/howwork12-1.png" style="display: block; margin: auto;" title="" width="40%"> --- count: false # How does `BCEA` work? ```r ceplane.plot(m,wtp=20000,xlim=c(-.002,.002),ylim=c(-10,20)) ``` <img src="./img/howwork13-1.png" style="display: block; margin: auto;" title="" width="45%"> --- count: false # How does `BCEA` work? ```r # Using 'ggplot', you can go crazy with customisation... ceplane.plot(m,wtp=10000,`graph="gg"`,point_colors="blue",point_sizes=.8,area_color="springgreen3") ``` <img src="./img/howwork14-1.png" style="display: block; margin: auto;" title="" width="45%"> <span style="display:block; margin-top: -40px ;"></span> .small[<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path></svg> [https://ggplot2.tidyverse.org/](https://ggplot2.tidyverse.org/)] --- count: false # How does `BCEA` work? ```r # Plots the Cost-Effectiveness Acceptability Curve ceac.plot(m) ``` <img src="./img/howwork15-1.png" style="display: block; margin: auto;" title="" width="45%"> --- count: false # How does `BCEA` work? ```r # Plots the Expected Value of Partial Information (EVPI) evi.plot(m) ``` <img src="./img/howwork16-1.png" style="display: block; margin: auto;" title="" width="45%"> --- # Specialised plots - Can generate a *contour* plot of the cost-effectiveness plane and estimate the proportion of points in each quadrant .left-column[ ```r # "Basic" contourplot contour(m) ``` ] .right-column[ <img src="./img/howwork18-1.png" style="display: block; margin: auto;" title="" width="65%"> ] --- count: false # Specialised plots - The specialised function `contour2` also shows the **sustainability area** .pull-left[ ```r contour2(m) ``` <img src="./img/howwork19-1.png" style="display: block; margin: auto;" title="" width="80%"> ] .pull-right[ <span style="display:block; margin-top: -0px ;"></span> ```r contour2(m,wtp=100) ``` <img src="./img/howwork20-1.png" style="display: block; margin: auto;" title="" width="80%"> ] --- count: false # Specialised plots ### Cost-effectiveness efficiency frontier .pull-left[ ```r ceef.plot(m,print.plot=FALSE) ``` ``` Cost-effectiveness efficiency frontier summary Interventions on the efficiency frontier: Effectiveness Costs Increase slope Increase angle Status quo -0.00105595 9.6555 NA NA Vaccination -0.00080537 14.6914 20098 1.5707 ``` ] .pull-right[ <span style="display:block; margin-top: -0px ;"></span> ```r ceef.plot(m,print.summary=FALSE) ``` <img src="./img/howwork20tris-1.png" style="display: block; margin: auto;" title="" width="80%"> ]--- # Exporting graphical output - `R` has excellent graphical facilities and the graphs produced by `BCEA` can be easily exported to many different formats ```r # "Opens" the graphical device pdf("NAME_OF_THE_FILE",width=`8`,height=`8`) `# for 'pdf', units are in inches` # Makes the plot ceplane.plot(`BCEA_OBJECT`) `# of course, specify whatever name you've chosen when creating the object...` # "Closes" the graphical device dev.off() # "Open" the graphical device" jpeg("NAME_OF_FILE.jpg",width=`480`,height=`480`) `# for 'jpeg' units are in px` # Makes the plot ceplane.plot(BCEA_OBJECT) # "Closes" the graphical device dev.off() ``` <span style="display:block; margin-top: 30px ;"></span> **NB**: `Rstudio` and [`rmarkdown`](https://rmarkdown.rstudio.com/) can do even more – that's for another time... --- class: empty-slide .huge[Part II] # Advanced use of `BCEA` --- # Multiple treatment comparisons ## Probabilistic "depression model" - Fictional model comparing antidepressants to cognitive behaviour therapy (CBT) and no treatment in people with depression - Statistical modelling based on evidence synthesis - Benefits: based on QALYs - Costs: associated with treatments and various resources use - Economic modelling: two matrices with relevant population summaries - `effects` - `costs` <span style="display:block; margin-top: 30px ;"></span> - NB: The details of the actual modelling are *not* important for the purposes of demonstrating the example... --- count: false # Multiple treatment comparisons ## Probabilistic "depression model" .pull-left[ ```r # Intervention labels t.names<-c("No treatment","CBT","Antidepressant") # "Standard" analysis: pairwise comparisons depression.bcea = bcea(effects,costs, interventions=t.names,`ref=3`) # `the third intervention is the reference` # Plots the results plot(depression.bcea) ``` ] .pull-right[ <img src="./img/depression3-1.png" style="display: block; margin: auto;" width="90%"> ] --- count: false # Multiple treatment comparisons ## Probabilistic "depression model" .pull-left[ ```r # For `multiple treatment comparison` depression.multi.ce = `multi.ce`(depression.bcea) # Specialised plot method `mce.plot`(depression.multi.ce,pos=c(1,0.8), graph=c("base","ggplot2")) ``` ] .pull-right[ <img src="./img/depression5-1.png" style="display: block; margin: auto;" width="90%"> ] --- count: false # Multiple treatment comparisons ## Probabilistic "depression model" .pull-left[ <span style="display:block; margin-top: 20px ;"></span> - Can use `ggplot` to customise the graph ```r mce.plot(depression.multi.ce,pos=c(1,1),graph="ggplot2") + ggplot2::stat_summary(fun=max, geom="line", colour="grey25", alpha=.3, lwd=2.5) ``` ] .pull-right[ <img src="./img/depression7-1.png" style="display: block; margin: auto;" width="90%"> ] --- count: false # Multiple treatment comparisons ## Probabilistic "depression model" .pull-left[ <span style="display:block; margin-top: 20px ;"></span> - Can use a specialised plotting method for the *cost-effectiveness acceptability **frontier*** ```r # Specialised plot ceaf.plot(depression.multi.ce) ``` ] .pull-right[ <img src="./img/depression9-1.png" style="display: block; margin: auto;" width="90%"> ] --- # `BCEAweb` - Inspired by similar projects – eg [SAVI](http://savi.shef.ac.uk/SAVI/) - Create a web interface to use BCEA without even opening R (or even having it installed on your computer!) <span style="display:block; margin-top: 40px ;"></span> -- - Typical work flow 1. Design the economic model (eg Markov model, decision tree, ...) 2. Run the statistical analysis to estimate the quantities of interest (eg survival analysis, evidence synthesis, ...) 3. Run the economic model and obtain "PSA samples" -- <span style="display:block; margin-top: 40px ;"></span> 4. Upload "PSA samples", including values for `\((e,c)\)` to `BCEAweb` 5. Use `BCEA` in the background to do **all** the economic analysis 6. Create reports that can be used as the basis for papers, reimbursement files, ... --- count: false # `BCEAweb` ```r # Creates a matrix with the underlying model simulations inp = CreateInputs(vaccine, print.lincom=FALSE) # Runs BCEAweb BCEAweb(e=e, # matrix of simulations for the effectiveness c=c, # matrix of simulations for the costs parameters=inp$mat # matrix of simulations for all the model parameters ) ``` <span style="display:block; margin-top: 30px ;"></span> - `BCEAweb` exists as a standalone webapp - Can access it <svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M503.52,241.48c-.12-1.56-.24-3.12-.24-4.68v-.12l-.36-4.68v-.12a245.86,245.86,0,0,0-7.32-41.15c0-.12,0-.12-.12-.24l-1.08-4c-.12-.24-.12-.48-.24-.6-.36-1.2-.72-2.52-1.08-3.72-.12-.24-.12-.6-.24-.84-.36-1.2-.72-2.4-1.08-3.48-.12-.36-.24-.6-.36-1-.36-1.2-.72-2.28-1.2-3.48l-.36-1.08c-.36-1.08-.84-2.28-1.2-3.36a8.27,8.27,0,0,0-.36-1c-.48-1.08-.84-2.28-1.32-3.36-.12-.24-.24-.6-.36-.84-.48-1.2-1-2.28-1.44-3.48,0-.12-.12-.24-.12-.36-1.56-3.84-3.24-7.68-5-11.4l-.36-.72c-.48-1-.84-1.8-1.32-2.64-.24-.48-.48-1.08-.72-1.56-.36-.84-.84-1.56-1.2-2.4-.36-.6-.6-1.2-1-1.8s-.84-1.44-1.2-2.28c-.36-.6-.72-1.32-1.08-1.92s-.84-1.44-1.2-2.16a18.07,18.07,0,0,0-1.2-2c-.36-.72-.84-1.32-1.2-2s-.84-1.32-1.2-2-.84-1.32-1.2-1.92-.84-1.44-1.32-2.16a15.63,15.63,0,0,0-1.2-1.8L463.2,119a15.63,15.63,0,0,0-1.2-1.8c-.48-.72-1.08-1.56-1.56-2.28-.36-.48-.72-1.08-1.08-1.56l-1.8-2.52c-.36-.48-.6-.84-1-1.32-1-1.32-1.8-2.52-2.76-3.72a248.76,248.76,0,0,0-23.51-26.64A186.82,186.82,0,0,0,412,62.46c-4-3.48-8.16-6.72-12.48-9.84a162.49,162.49,0,0,0-24.6-15.12c-2.4-1.32-4.8-2.52-7.2-3.72a254,254,0,0,0-55.43-19.56c-1.92-.36-3.84-.84-5.64-1.2h-.12c-1-.12-1.8-.36-2.76-.48a236.35,236.35,0,0,0-38-4H255.14a234.62,234.62,0,0,0-45.48,5c-33.59,7.08-63.23,21.24-82.91,39-1.08,1-1.92,1.68-2.4,2.16l-.48.48H124l-.12.12.12-.12a.12.12,0,0,0,.12-.12l-.12.12a.42.42,0,0,1,.24-.12c14.64-8.76,34.92-16,49.44-19.56l5.88-1.44c.36-.12.84-.12,1.2-.24,1.68-.36,3.36-.72,5.16-1.08.24,0,.6-.12.84-.12C250.94,20.94,319.34,40.14,367,85.61a171.49,171.49,0,0,1,26.88,32.76c30.36,49.2,27.48,111.11,3.84,147.59-34.44,53-111.35,71.27-159,24.84a84.19,84.19,0,0,1-25.56-59,74.05,74.05,0,0,1,6.24-31c1.68-3.84,13.08-25.67,18.24-24.59-13.08-2.76-37.55,2.64-54.71,28.19-15.36,22.92-14.52,58.2-5,83.28a132.85,132.85,0,0,1-12.12-39.24c-12.24-82.55,43.31-153,94.31-170.51-27.48-24-96.47-22.31-147.71,15.36-29.88,22-51.23,53.16-62.51,90.36,1.68-20.88,9.6-52.08,25.8-83.88-17.16,8.88-39,37-49.8,62.88-15.6,37.43-21,82.19-16.08,124.79.36,3.24.72,6.36,1.08,9.6,19.92,117.11,122,206.38,244.78,206.38C392.77,503.42,504,392.19,504,255,503.88,250.48,503.76,245.92,503.52,241.48Z"></path></svg> [here](https://egon.stats.ucl.ac.uk/projects/BCEAweb/) - **Or**, you can launch your own "local" version from the `BCEA` package (as in the code above)! - This will launch a web page from which you can manipulate your output (<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg" style="height:1em;fill:currentColor;position:relative;display:inline-block;top:.1em;"> [ comment ] <path d="M256 8c137 0 248 111 248 248S393 504 256 504 8 393 8 256 119 8 256 8zm-28.9 143.6l75.5 72.4H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h182.6l-75.5 72.4c-9.7 9.3-9.9 24.8-.4 34.3l11 10.9c9.4 9.4 24.6 9.4 33.9 0L404.3 273c9.4-9.4 9.4-24.6 0-33.9L271.6 106.3c-9.4-9.4-24.6-9.4-33.9 0l-11 10.9c-9.5 9.6-9.3 25.1.4 34.4z"></path></svg> Live Demo) --- class: thankyou-michelle