Automatic drug utilization reports with R and ggplot2

[This article was first published on John Marquess » R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This program takes a data set of drug utilisation of 4 fictional drugs in 10 fictional hospitals and plots each time-series with a locally weighted regression (Lowess) trend line. It also places an time-series trend of the usage for each drug that is aggregated across all included hospitals. The results are facetted by hospital service, in this case surgical and medical.

The purpose of writing the program was to develop a method to automatically generate antibiotic utilisation reports for individual hospital so that hospital managers could compare usage. The reports could be used as part of antimicrobial stewardship programs at local or system level.

Here is an example of one of the generated reports. It is probably a good idea to run this through R studio as it has a nicely integrated chart viewer.

hospitala

 

And here is the code that generated the report.


The data are available here if you want to use them yourself

To leave a comment for the author, please follow the link and comment on their blog: John Marquess » R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)