Data visualization with Stata: How to adapt APIs and take benefit of HTML5 Canvas to create dynamic charts and maps with Stata
Thomas Roca
2014-09-28
Abstract:Data visualization is a burgeoning field at the crossroads of design, computer science, and statistics. Using HTML and applying data visualization techniques allows the creation of elegant and insightful representations with Stata. Nevertheless, creating original "dataviz" from an empty page is rough: it requires specific programming knowledge. Thankfully, many pieces of code have been developed under GNU/GPL or Apache licence, accessible for free (Google APIs are the most famous ones). However, these pieces of code need to be adapted; many options are available to modify displays (texts, legends, labels, colours, size, type of representation, etc.) Besides, HTML5 now embeds a powerful graphic and drawing engine: Canvas, which can be mobilized to represent any data, starting from scratch. As underlying datasets need to be reshaped and organized, a fair amount of programming becomes necessary; thus, Stata users possess a great asset to fill in and format HTML and Java content. Specific programs will be discussed: Google Geomap package creates heat maps using Google's API. Donut chart package builds two-layer pie charts supported by Highchart's API. The project "How good are you converting your income into..." is a simple data visualization created with Stata using HTML5 Canvas, which easily allows flagging outliers. This dataviz will be presented as an introduction to the use of Canvas with Stata. Dynamic Scatter Plot, fuelled with HTML5 Canvas, can represent three variables, and displays additional information when you scroll over with the mouse. Furthermore, two Dynamic Scatter Plots can be superimposed to facilitate comparisons. To help you grasp the possibility offered by Stata in web programming, I will present the Country Dashboards project. It shows how to create a comprehensive web portal, embedding hundreds of dataviz and webpages built with Stata. Creation-Date: 20140928
Computer Science