<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/predicting-the-length-of-a-hospital-stay-with-r/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.revolutionanalytics.com/2017/03/hospital-length-of-stay.html"> Revolutions</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div>
<p>I haven't been admitted to hospital many times in my life, but every time the only thing I really cared about was: when am I going to get out? It's also a question that weighs heavily on hospital managers: by knowing ahead of time how long each patient's stay is likely to be, they can better manage facilities and staff, and know whether the hospital is likely to reach maximum capacity in the near future.</p>
<p>To help hospital administrators better predict how long patients are likely to stay, Microsoft has published the <a target="_blank" rel="nofollow" href="https://gallery.cortanaintelligence.com/Solution/Predicting-Length-of-Stay-in-Hospitals-1">Predicting Length of Stay in Hospitals</a> solution on the Cortana Intelligence Gallery. Clicking on &quot;deploy&quot; creates an instance of the Data Science Virtual Machine with simulated patient data in SQL Server, and a model implemented with R Services to predict the length of stay. The predictions are then presented as a Power BI dashboard to a Care Line Manager or a Chief Medical Information Officer as shown below. (Click the Try It Now button on <a target="_blank" rel="nofollow" href="https://gallery.cortanaintelligence.com/Solution/Predicting-Length-of-Stay-in-Hospitals-1">this page</a> to interact with the dashboard.)</p>
<p><a target="_blank" rel="nofollow" href="https://gallery.cortanaintelligence.com/Solution/Predicting-Length-of-Stay-in-Hospitals-1"><img title="Care line mgr" alt="Care line mgr" src="http://revolution-computing.typepad.com/.a/6a010534b1db25970b01b7c8dbdd2d970b-800wi" border="0"></a></p>
<p>The underlying model is a Random Forest implemented with <code>rxDForest</code> in the <a target="_blank" rel="nofollow" href="https://msdn.microsoft.com/en-us/microsoft-r/scaler-getting-started">RevoScaleR package</a>. (The data science process behind training the model is <a target="_blank" rel="nofollow" href="https://microsoft.github.io/r-server-hospital-length-of-stay/data-scientist.html">described here</a>, and the R code is available in this <a target="_blank" rel="nofollow" href="https://github.com/Microsoft/r-server-hospital-length-of-stay/tree/master/R">Github repository</a>). The model is trained using simulated patient lab and diagnosis data, and observed lengths of stay. For hospitals that want to build a similar model using real data, the <a target="_blank" rel="nofollow" href="https://microsoft.github.io/r-server-hospital-length-of-stay/index.html">Predicting Hospital Length of Stay</a> solution page provides detailed background on configuring a similar service in a <a target="_blank" rel="nofollow" href="https://microsoft.github.io/r-server-hospital-length-of-stay/CIG_Workflow.html">cloud-based architecture</a> or installed in a <a target="_blank" rel="nofollow" href="https://microsoft.github.io/r-server-hospital-length-of-stay/Typical_Workflow.html">private data center</a>. </p>
<p>For more details on the solution, take a look at this <a target="_blank" rel="nofollow" href="https://blogs.msdn.microsoft.com/rserver/2017/02/15/predicting-hospital-length-of-stay-los-using-sql-server-2016-with-r-services/">MSDN blog post</a>, visit the <a target="_blank" rel="nofollow" href="https://gallery.cortanaintelligence.com/Solution/Predicting-Length-of-Stay-in-Hospitals-1">Cortana Intelligence Gallery</a>, or browse the detailed solution page linked below.</p>
<p>GitHub (Microsoft): <a target="_blank" rel="nofollow" href="https://microsoft.github.io/r-server-hospital-length-of-stay/">Predicting Hospital Length of Stay</a></p>
<p> </p>
</div>
<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://blog.revolutionanalytics.com/2017/03/hospital-length-of-stay.html"> Revolutions</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 title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/search/data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/search/map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/search/animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/search/sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/search/SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/search/eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/search/git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/search/hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/search/regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/search/PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/search/time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/search/trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/P9fB5Iwv0KY"></a></div>