Case for Optimism
I was eating a Chipotle burrito the other day and I came across a short but poignant essay on the bag of my food as I was mindlessly munching away.
Optimism, a numbers game
The essay was from a writer by the name of Steven Pinker and the essay was entitled "A Two-Minute Case for Optimism" and in it he posits that although many believe the world is becoming a worse place, it is in fact becoming a better place; we know this because we can count. We can count the number of problems in our world and compare those numbers to earlier times, and the numbers show that the world is getting better.
Let's talk about the data set.
I obtained my data set from the World Bank under their metrics known as the World Development Indicators. Because it was such a large data set, I tried to subset the data by choosing only the variables associated with health. I encountered problems while attempting to turn these data into an interactive chart using R Shiny so I subsetted my data further into two simple variables: a subset of Life Expectancy in the US for males, and a subset for females.
Here is an output of the resulting R Shiny app.
Let's talk about packages.
Prior to doing any work on the actual R Shiny app, I tried to get my data as clean as possible by removing any unnecessary columns and checking through my data to see if the analysis I was going to give had data to show (this is in contrast to my Data Visualization project where I did not do this step). My initial thought was to use the dygraphs package in R to present my information. I spent most of my time trying to understand the intricacies of user input and output for R Shiny.
I cannot stress enough how important it is to understand the libraries needed to accomplish the goals for your project and the formats and syntax compatible with those libraries.
When I started to work with the dygraphs package it soon became apparent that my data, although clean, was not in the right orientation. With only a few hours left, I did not have enough time to learn the Reshape package that would help me transpose my data, as the base R package was not able to handle a my complicated transposition. Thus I ended up with only one variable with male and female groups and used the GoogleVis package. I would highly recommend GoogleVis to anyone looking to have an interactive exploratory experience with data. It is simple to use and very powerful in terms of visualization options.
Optimism, gritty and nuanced
This essay struck me because in his conclusion Steven Pinker presented an optimism not of naiveté and romanticism but rather an optimism rooted in the challenges of the present and resolved toward improving the future. You will notice that in the graph, despite the progress in increasing life expectancy overall, there is still a gap between the life expectancy of men vs. women. When women died in child birth earlier in our history we did not simply accept that as a part of human biology and ignore the problem, we sought to apply science and medicine to improve the outcomes. Similar, we should not look at lower life expectancy for males as something to be ignored but as impetus for further discussion and exploration to improve outcomes in this aspect.
My personal goal is to refine my skills on the Reshape package in R. I believe this will be of a lot of use if I work with companies that make use of a lot of pivot tables and perhaps need a more robust program such as R to handle larger data sets. I hope that I can work on this project further and transpose my other data so that I can use all the health data I extracted and give users an opportunity to explore the data on their own.
Thanks to Chipotle for giving me food as well as food for thought.