Automatic drug utilization reports with R and ggplot2

September 18, 2012

(This article was first published on John Marquess » R, and kindly contributed to R-bloggers)

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.



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. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , ,

Comments are closed.


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)