WONK STATE
  • Blog
  • About

Optimizing my commute

11/26/2018

1 Comment

 
Since November 1st, I have been using Google's map API and running a cronjob every five minutes on an EC2 to collect data on my morning and evening commutes. The work is ongoing, but you can find the code (and eventually the full write-up) on my Github page. It is too early to draw conclusions- my period of observation is limited and still includes Thanksgiving and other holidays- but so far the mean weekday duration curve is depressingly flat between 8:00 and 9am on weekdays (varying by less than 2 minutes, on average).
Plot 535
The code will be generalizable for others to use (after creating Google maps API and AWS accounts). For my own route, I plan to analyze variation in trip duration by time, seasonal trends, and the effect of traffic density on route selection (so far Google has recommended more than 70 different routes!). I also plan to extend the hours of observation to 10am to allow the curve to fully revert to non-rush hour durations.  
1 Comment

Distribution of Impactful Life Events

5/8/2018

1 Comment

 
Presidents are either having more eventful presidencies or arriving to office with less meaningful/interesting life experience. I scraped every date from each president's wikipedia page (choosing to limit dates to within +/- 40 years of their first year in office and only looking at deceased presidents) to quantify where the 'historical record' places the meaningful life events of each president.

​The graphic below shows the difference between the average date on each president's wikipedia page and their first year in office (the pinkish bars show the number of years they lived after their presidency. NOTE: you can hover over the plot to see which President is represented. The outlier is William Harrison... who died a month after taking office).
plot from API (23)
There is a positive correlation between the date differentials and the number of years lived after each presidency, but it is weaker than the correlation between the date differential and the first year of each presidency (0.52 > 0.34 - years lived after presidency is uncorrelated with the first year of presidency: 0.03). So while the number of post-presidential years explains some of the variation in the date differentials, there is also likely a time trend in the profile of each president that is impacting the date differential (or a bias in the way wikipedia authors interpret recent presidents' lives- a distinct possibility). 
1 Comment

Self-reverence in Inaugural Addresses

4/27/2018

1 Comment

 
Again from the presidential dataset I am working with... I was interested to see if US presidents have become more self-centered/self-reverential over time (using the frequency of 'me', 'I', and 'my' in each address as a proxy). If anything (see below), the trend is in reverse; there seems to be a gradual decline in the use of the first person singular. Interestingly, only one president, Teddy Roosevelt, avoided use of both 'I' and 'me', all presidents used 'my' at least once, and Obama, Trump (shockingly), Bush Sr., Coolidge, and JFK avoided using 'me'. 
Picture
In general, presidents' inaugural addresses have more in common with their recent predecessors and immediate successors. Given the rapidly changing human landscape, and the evolution of the English language, it is not surprising that mundane word choice, rather than left/right intellectual persuasion, wins out. Nonetheless, there are some interesting results within shorter time windows (for instance, Obama's inaugurals had more in common with Nixon's & Reagan's than Carter's) .The heat map below shows the cosine similarities of the speeches. 
heatmap1
1 Comment

Presidential Life Span

4/26/2018

1 Comment

 
I'm working on a project to capture variation in each president's wikipedia page length- you can find the code here- as well as identifying the linguistic proximity between the wikipedia page and each president's inaugural addresses (hoping to use this proximity as a success measure for each president. i.e. if the themes/language a president chooses for the address closely align with their wiki page, perhaps it is a reflection of the president's stated achievements in the historical record). Anyways, while I am working on that I am also throwing together some graphics. Here is one for birth year and life span (of course, doesn't account for currently living presidents). 
Picture
I patched together US male life expectancy from a couple of sources, but it is a reasonable approximation. Not surprisingly, presidents have lived considerably longer than the majority of the male population- the only exception being JFK (who is the youngest elected president at 43. Teddy Roosevelt is the youngest serving president- having assumed the office at 42 after the assassination of William McKinley). 
1 Comment

First time drug use

4/20/2018

1 Comment

 
I've begun playing with data from the 2016 National Survey on Drug Use and Health for one of my next projects and will be throwing up some graphics as I go through my EDA.  The following shows cocaine users (11.6% of the US population has used cocaine) and marijuana users (41.85% of the US population has used marijuana) by the month they first used that drug. They are highly correlated (0.73 Pearson correlation, with only 0.54% of observations in a 100,000 hacker stat permutation test surpassing this value). 
With the admitted ignorance of someone who has never studied drug use, my take away looking at the graph above is that there is likely a large overlap in users and/or common seasonal components that drive first consumption. First use for both spikes in June (Summer or end of school celebration?) with a second peak for cocaine in January (investment banker bonus season?) and for marijuana in October (Halloween perhaps?). 
1 Comment

Consumer Behavior on Twitter (fast food)

3/30/2018

1 Comment

 
The visualization below is from a larger project I am working on in Python related to consumer behavior on Twitter. You can follow the full project as it is being finalized here. The visualization highlights the variation in consumer profiles across businesses and how they vary within each business (The bars represent medians, whereas the coloration represents mean. Incongruities between the two represent a skewed distribution of consumer characteristics, which may indicate bots, the presence of super-users, or something else as yet undetermined)
1 Comment

Exchange Rates and Exports

3/27/2018

1 Comment

 
The collapse of Bretton Woods in 1971 (a result of Nixon decoupling the US dollar from gold)  tested our understanding of the role of nominal exchange rate volatility on trade and the real economy. Although the IMF concluded in the 1980s that it was unlikely that increased volatility would have a significant negative impact on trade volume, it was less clear how volatility (and potential manipulation) would affect resource allocation and bilateral trade imbalances.   

With trade and currency manipulation back in the news, I was interested in visually exploring the relationships between exports, exchange rates, and purchasing power parity (through The Economist's Big Mac Index).  Using data from the US Census, WTO, and The Economist, I looked at the changes in these areas from 2006 through 2017.

Read More
1 Comment

Churchill under Fire: The British Reconquest of Sudan and the Battle of Omdurman

10/4/2017

2 Comments

 
(Author's note: This is a slightly longer piece than usual. I have been interested in the British reconquest of Sudan since stumbling upon it while reading William Manchester's The Last Lion years ago. Once I finally got around to researching and writing about it, I found it hard to stop.)

At the Edge of Empire

Riding at the head of his scouting party, Winston Churchill was likely the first British officer to catch a glimpse of Khartoum.  What he saw was less a city than a skeleton, having being abandoned after the violent expulsion of the British from Sudan 13 years earlier. At the city’s edge rose a new settlement, Omdurman, comprised of mud huts and centered on the domed tomb of the Mahdi—the Islamic uprising’s prophetic leader. It was 9am and the heat on the desert plain was already intense. Vultures circling overhead lent the landscape an eerie stillness. Missing from the landscape, to the relief of many in the scouting party, if not Churchill, was the great army of the Mahdi. All they could see for miles around the city were a line of low brush, the mighty Nile, and the unforgiving desert.
Picture
Sudanese soldiers under British command at the Battle of Omdurman. (Photo from britishbattles.com)
​As Churchill began to imagine that the cities would fall without resistance, the line of brush moved against the horizon. What he had believed to be vegetation was in fact an army of 60,000 extending miles into the desert. The fanatic defenders of Omdurman unfurled banners of Quranic scripture while the metal of their swords and spears glimmered across the horizon with the rising sun. Churchill, who would be no stranger to grand armies, would write of his view across the desert plain that morning as, “perhaps the impression of a lifetime.” It was September 1st, 1898 and within 24 hours Churchill would be on horseback surrounded by 3,000 screaming warriors and locked in the sights of two enemy rifles.  He would be at the heart of the last great cavalry charge of the British Empire and lucky to escape with his life.   ​

Read More
2 Comments

El Éxodo de los Venezolanos

7/4/2017

0 Comments

 
La crisis vigente en Venezuela está creando un éxodo de Venezuela parecido al el de Siria. Hay estimados que más que diez por ciento de la población venezolana ha emigrado (o más de 3 millones). Al principio de la revolución bolivariana, la fuga fue caracterizado principalmente por los ricos—escapando con dinero en riesgo de estar usurpado por el régimen. Hoy en día, todos se van. Por qué? Pues, la dieta Madurana sería una causa. En el año pasado, 74% de la población perdió peso (un promedio de 8.7 kilos). La adición de la escasez de medicamentos, falta de trabajo, e inflación de proporciones bíblicas solo sirven agregar a la desesperación. 
Picture
El refrigerador de una mujer recientemente en Venezuela (Imagen de America's Quarterly- Rafael Hernandez)
​Para los afortunados que podían obtener una visa a los Estados Unidos o España, éstos son los destinos preferidos. En los Estados Unidos, 18,155 solicitaron por asilo en el año pasado (la cantidad más grande de cualquier nación). Para esos menos afortunados, la huida pasa por las fronteras terrenales. La mayoría termina en Colombia; un país que comparte una frontera de 2,200 kilómetros con Venezuela y, irónicamente, en el pasado se vio una huida en la dirección opuesta (debido a la violencia narcotraficante). 
Venezuela rechaza la idea que existe una fuga de ‘refugiados’ desesperados. Pero al mismo tiempo, ellos no se han difundido estadísticas sobre inmigración en una década. Los estimados se dicen que más que 2 millones se han mudado a Colombia desde el principio de la reina de Chavez. Esta comunidad desplazada no tiene ningún estatus legal en Colombia y tiene que vivir abrumadoramente en la pobreza. Sin embargo, con las condiciones actuales en Venezuela, estas condiciones son preferibles en comparación con la vida cotidiana venezolana. 
0 Comments

Comicios estatales en México

6/5/2017

0 Comments

 
​Hubo comicios ayer en cuatro estados en México con potenciales implicaciones para la votación presidencial del próximo ano. El más importante, en el estado de México, pasaba sin la retumbante derrota de candidato priista Alfredo Del Mazo por Delfina Gomez (candidata de Morena—el partido izquierdista fundado por Obredor (OMLA)). El estado de México es el más poblado del país y pudiera haber señalado la fuerza de Obredor como candidato para la presidencia y la alza en general de su partido. 
Picture
El PRI gobernó México desde la revolución hasta 2000. Hoy en día, controlan la presidencia, pero mantiene una tasa de impopularidad histórica.
El estado de México ha estado encontrado ser el más corrompido en el país y la situación de seguridad ha empeorado en años recientes. Todavía, el PRI ha gobernado en el Estado de México desde el principio de la república y el partido gastó mucho dinero y capital política para ganar el concurso. La victoria por tres puntos debería provenir un poco aliento al angustiado establecimiento político, cual ha estado tan preocupado por el poder creciente de OMLA—especialmente dado la atmosfera toxica norteamericana poniendo combustible la venidera elección mexicana. 
Además, en los dos comicios adicionales en Coahuila y Nayarit (ambos controlados por PRI anteriormente) se aparece que el PRI ganará en Coahuila mientras el PAN ganará en Nayarit. La victoria del PRI en Coahuila era inesperada, dado la impopularidad histórica de este partido nacionalmente. Hay rumores que el PRI no cree internamente que puedan ganar la próxima elección presidencial—tal vez este resultado cambie esta opinión. 
0 Comments
<<Previous

    Categories

    All
    Behavioral Economics
    Business
    Costo De La Vida
    Crimen
    Criminal Justice
    Debt
    Defense
    Domestic Policy
    Economics
    Elections
    Entertainment
    Europe
    Foreign Policy
    Greece
    Health
    History
    Injustice
    Libre Comercio
    Marketing
    Markets
    Mexico
    Paraguay
    Popular Culture
    Regression Analysis
    Review
    Television
    Trade
    Tratados Internacionales
    Trump
    Turismo
    Urban Planning
    Venezuela

    Archives

    November 2018
    May 2018
    April 2018
    March 2018
    October 2017
    July 2017
    June 2017
    April 2017
    March 2017
    November 2015
    October 2015
    September 2015
    August 2015
    July 2015
    October 2014

    RSS Feed

    Please fill in the contact form below to have new articles emailed to you directly! 

      Contact Form

    Submit
Proudly powered by Weebly
  • Blog
  • About