<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/individual-level-data/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://statistica.it/tutorial/ipd/"> R on Gianluca Baio</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<h2>Cost-effectiveness analysis with individual level data</h2>
<p>You can do this practical either directly in <tt>BUGS</tt>, or running the scripts from <tt>R</tt>. If you are using the <tt>BUGS</tt> graphical interface, then you will need to open the relevant model files (e.g. <tt>normal-mod.txt</tt>}, <tt>cgeg-mod.txt</tt>), together with the relevant data (e.g. <tt>cost-data.txt</tt> or <tt>cost-util-data.txt</tt>). Notice that for these models it is important to specify suitable initial values (particularly for the Gamma-Gamma specification), or else <tt>BUGS</tt> may struggle to start the simulations. Conversely, if you are working directly in <tt>R</tt>, you can follow the script <tt>IPD_analysis.R</tt>}, which will guide you through the several steps and analyses required.</p>
<ol>
<li>
<p>Analyse the cost data for the two arms of the trial. The relevant <tt>BUGS</tt> model is coded in the file <tt>normal-mod.txt</tt>. Make sure you understand the code and then run it using the data stored in <tt>cost-data.txt</tt>. Costs are in £1000s, so that <tt>OpenBUGS</tt> does not “overflow” during calculations with large numbers. The initial values are stored in the files <tt>normal-inits1.txt</tt>, <tt>normal-inits2.txt</tt>, <tt>normal-inits3.txt</tt> (if you want to use 2 chains, you can select either two of these three).</p>
<ol>
<li>
<p>Monitor the relevant nodes (decide based on your understanding of the model and the questions below. The <tt>R</tt> scripts can give you some hints if you are undecided).</p>
</li>
<li>
<p>What is the mean cost in each arm and the mean difference in costs between arms? (The <tt>R</tt> script also has a few more commands to manipulate the output of your simulations and produce more sophisticated and useful analyses).</p>
</li>
</ol>
</li>
<li>
<p>In the file <tt>normal-mod.txt</tt>, some code is included to calculate the deviance, a measure of model fit. The quantity -2<span>\(\times\)</span>log likelihood of a normal distribution is written out in <tt>BUGS</tt> model code.</p>
<ol>
<li>
<p>Re-run the model, this time making sure you monitor the relevant nodes associated with the deviance analysis (you can skip this part if you have already monitored all the relevant nodes).</p>
</li>
<li>
<p>What is the deviance of the model, using this method?</p>
</li>
<li>
<p>Find the deviance by setting a monitor for the variable deviance.</p>
</li>
<li>
<p>Find the deviance using the DIC feature from the menus in <tt>OpenBUGS</tt>. .</p>
</li>
</ol>
<p>Make sure the answers from methods b, c and d match.</p>
</li>
<li>
<p>Now analyse the cost and utility data for the two arms of the trial. The relevant <tt>BUGS</tt> model is coded in the file <tt>cgeg-mod.txt}. Inspect it and check the <tt>BUGS</tt> code makes sense.
<ol>
<li>
<p>Using the data in <tt>cost-util-data.txt</tt> and the initial values in the files <tt>cgeg-inits1.txt</tt>, <tt>cgeg-inits2.txt</tt>, <tt>cgeg-inits3.txt</tt> (if you want to use 2 chains, you can select either two of these three), run the model. If you are using <tt>BUGS</tt>, update the model for 1000 iterations. Monitor at least the nodes <tt>delta.e</tt>, <tt>delta.c</tt>, <tt>INB</tt> and <tt>CEAC</tt>. Then update the model for a further 3000 iterations.</p>
</li>
<li>
<p>Plot the cost-effectiveness plane. .</p>
</li>
<li>
<p>What are the point and 95% interval estimates for the Incremental Net Benefit (INB), when the willingness-to pay is £500 per day saved in hospital? Is this consistent with the values of <tt>delta.e</tt> and <tt>delta.c</tt> _(Hint: Find the appropriate <tt>j</tt> from <tt>K[j] = (j-1)*K.step</tt>, in your model code. The <tt>R</tt> file has more sophisticated code to do this)_.</p>
</li>
<li>
<p>What is the probability that the intensive treatment (arm 2) is cost-effective for a willingness-to-pay of £500 per day saved in hospital? <em>\textit{</em>(Hint: the <tt>R</tt> script shows all the necessary steps to compute numerically this probability. In the <tt>BUGS</tt> interface, you could modify the model code to get this number, or you could simply use the density of the relevant <tt>INB</tt> to assess this visually)._</p>
</li>
<li>
<p>Draw a cost-effectiveness acceptability curve. <em>(Hint: <strong>Inference <span>\(\Rightarrow\)</span> Compare</strong>, enter <tt>CEAC</tt> for <strong>node</strong> and <tt>K</tt> for <strong>axis</strong>, and click on <strong>scatter</strong>. <strong>Right-button-click on the graphics <span>\(\Rightarrow\)</span> Properties</strong>. Explore the options to get a nice CEAC. The <tt>R</tt> script does this with more sophistication)</em>.</p>
</li>
</ol>



	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://statistica.it/tutorial/ipd/"> R on Gianluca Baio</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/SfeaymYMT4U" height="1"></a></div></tt></ol></div>