Thursday, July 20, 2017

Map of the day: the public transport network of Tokyo

Simon Kuestenmacher tweeted the other day this map that shows the public transport network of Tokyo metropolitan area (higher quality image in Japanese here). Tokyo is today the largest metro area with almost 38 million people. The amount of planning and daily work they put in their transport network overt the decades it just jaw dropping, as this maps can tell. 

Monday, July 17, 2017

Vertical Hong Kong

Beautiful drone footage of Hong Kong, by Mariana Bisti (2017). It's better in full screen.

Friday, July 14, 2017

Heads up for some useful R packages

As you can see from this post, the community of R users and developers is alive and kicking on Twitter. If you would like to recommend other packages, send me an email or leave a comment on this post.

  1. data.table: high-performance data manipulation, by Matt Dowle and Arun Srinivasan. This is certainly among my favourite packages. I've been working with datasets of a few hundreds of millions observations and it makes things much faster. I stopped using dplyr long time ago

  2. tidycensus: a new library to get the US Census Bureau spatial and demographic data in R ready for use with sf and the tidyverse. This package was created by Kyle Walker, who is a must-follow if you're into R and spatial analysis

  3. mapview: interactive viewing of spatial objects in R, by Tim Salabim

  4. mapedit: interactive editing of spatial data in R, by Kent Russel

  5. ggsci, a collection color palettes inspired by colors used in scientific journals to be used in ggplot2, by Nan Xiao

  6. ourworldindata: a package by Simon Jackson to access the datasets from, which is a great project by Max Roser

  7. magick: advanced image-processing in R, which can be really useful for including gifs in your plots and impress reviewer #2 . ht Danielp Hadley

Sunday, July 9, 2017

Thursday, July 6, 2017

Bicycles empower women: evidence from a quasi-experiment in India

In 1896, the American civil rights leader Susan B Anthony wrote about the crucial role that the bicycle had in women's emancipation and independence. Gradually, more and more evidence shows she was right.

Four years ago we posted about a study by K. Muralidharan and N. Prakash, who analyzed an Indian program "... aimed to reduce the gender gap in secondary school enrolment by providing girls who continued to secondary school with a bicycle that would improve access to school". They have found that the program was an extremely cost-effective way to increase girls’ access to secondary schools and enrolment rates. Their paper just came out published in the American Economic Journal: Applied Economics. (ungated older version here).

Muralidharan, K., and Prakash, N.. 2017. "Cycling to School: Increasing Secondary School Enrollment for Girls in India." American Economic Journal: Applied Economics, 9(3): 321-50. 

We study the impact of an innovative program in the Indian state of Bihar that aimed to reduce the gender gap in secondary school enrollment by providing girls who continued to secondary school with a bicycle that would improve access to school. Using data from a large representative household survey, we employ a triple difference approach (using boys and the neighboring state of Jharkhand as comparison groups) and find that being in a cohort that was exposed to the Cycle program increased girls' age-appropriate enrollment in secondary school by 32 percent and reduced the corresponding gender gap by 40 percent. We also find an 18 percent increase in the number of girls who appear for the high-stakes secondary school certificate exam, and a 12 percent increase in the number of girls who pass it. Parametric and non-parametric decompositions of the triple- difference estimate as a function of distance to the nearest secondary school show that the increases in enrollment mostly took place in villages that were further away from a secondary school [> 3km], suggesting that the mechanism of impact was the reduction in the time and safety cost of school attendance made possible by the bicycle. We also find that the Cycle program was much more cost effective at increasing girls' secondary school enrollment than comparable conditional cash transfer programs in South Asia.

And here is an old video briefing on the study.

Assorted Links

  1. Using geographic profiling to investigate the real identity of Banksy. There is a nice interview with one of the authors about the paper in the podcast 'What's the point'

Monday, July 3, 2017

The rise of 'nuance' in the Social Sciences

About two years ago, we put a link to Kieran Healy's work titled "Fuck nuance". His study has now been published as a paper in Sociological Theory (ungated version here). One of his main arguments is that the search for more nuanced understandings of social phenomena often end up obstructing the development of robust social theories. This is certainly open for debate.

Although Kieran's paper focuses on studies in Sociology, he has recently expanded some his analysis to other fields of the social sciences, showing how the the percentage of articles mentioning the words ‘nuance’ or ‘nuanced’ has sharply risen since the 1990s in pretty much every field.

credit: Kieran Healy

Thursday, June 29, 2017

World population distribution by altitude

Another interesting chart by Bill Rankin, this one showing how the world population is distributed by altitude.
  • 6% of the world's population leaves above 1.6 Kilometres (1 mile)
  • 50% leaves below 165 meters of altitude
  • 0.2%  leaves below sea level
click on the image to enlarge it

Sunday, June 25, 2017

7th Anniversary of Urban Demographics !

Today is the 7th Anniversary of Urban Demographics. I hope the blog has been a valuable source of  procrastination  information for you as much as it has been for me. Thanks all the readers for the support \o/

Here are some stats that show a summary of the blog over the past year. Please, feel free to drop me a line with suggestions on how to improve the blog. If you have any criticisms, please direct them to this other blog here.

The most popular posts:
  1. How Brazil compares to other countries in terms of area, population and human development
  2. Mexicans didn’t cross the US border. The border crossed them 
  3. The people who keep us company throughout our life cycle
  4. Comparing house price trends worldwide
  5. The world’s most violent cities

and 10 of my favourite posts:
  1. How much of the world is covered by cities? not much
  2. The impressive expansion of subway systems in China
  3. Distributive justice and equity in transportation
  4. The cost of every Olympics Games since 1960
  5. Creating an animated world map of life expectancy changes from 1950 to 2100 in R
  6. Mapped history of population expansion in the US
  7. Income segregation at the block level
  8. Measuring exposure to air pollution using mobile phone data
  9. Map of Population Density Lines in R
  10. Visualizing the space-time geography of flow data

Where do readers come from? (202 Countries - 4,482 Cities) 
  • Brazil (44.6%) 
  • United States (17.9%) 
  • United Kingdom (4.6%) 
  • Mexico (2.8%) 
  • Russia (2.7%) 
  • other countries (27.4%) Not many readers in Siberia nor Greenland, though

    Thursday, June 22, 2017

    Urban Picture: Venice from above

    This picture comes from the Earth View, an extension for Chrome that displays some really beautiful satellite images from Google Earth every time you open a new tab. 

    ps. and some people tell me I procrastinate too much, yeah right.

    Wednesday, June 21, 2017

    Difference-in-differences for spatial data

    It just came to my knowledge today that Raymond Florax passed away a couple of months ago (in memorian). Prof. Florax was very influential in the field of spatial econometrics. In one his latest papers, he co-authored with Delgado and proposed a difference-in-differences method for spatial data, controlling for spatial dependence. Here is the paper.

    Delgado, M. S., & Florax, R. J. (2015). Difference-in-differences techniques for spatial data: Local autocorrelation and spatial interaction. Economics Letters, 137, 123-126.

    We consider treatment effect estimation via a difference-in-difference approach for spatial data with local spatial interaction such that the potential outcome of observed units depends on their own treatment as well as on the treatment status of proximate neighbors. We show that under standard assumptions (common trend and ignorability) a straightforward spatially explicit version of the benchmark difference-in-differences regression is capable of identifying both direct and indirect treatment effects. We demonstrate the finite sample performance of our spatial estimator via Monte Carlo simulations.

    Tuesday, June 20, 2017

    Assorted links

    1. Personal details of ~200 million US citizens exposed. A 1.1 terabyte data set with names, home addresses, phone numbers, political views etc. This is approx. 2/3 of the american population. Probably the largest data leak in history  thus far 

    2. I've recently found out that the principal scientist at Amazon‘s Modeling and Optimization team is Renato Werneck, a Brazilian researcher who is also one of the authors of Raptor, the Round-Based Public Transit Routing algorithm

    3. In the USA, both Democrats and Republicans agree there is a lot of discrimination against certain social groups. They just disagree which groups are discriminated against

    4. Health Effects of Overweight and Obesity in 195 Countries over 25 Years. Since 1980, obesity rates doubled in more than 70 countries and continuously increased in other countries

    Prevalence of Obesity at the Global Level, According to Sociodemographic Index (SDI)

    [click on the image to enlarge it]

    Sunday, June 18, 2017

    The effect of Uber on traffic congestion

    Early this year, a paper in PNAS using a computer model estimated that car sharing services like Uber and Lyft could reduce the number of taxi vehicles on roads by ~76% without significantly impacting travel time. As Joe Cortright has said, the authors are overly optimistic. 

    There is another study from last year that analyzed what actually happened to congestion levels when Uber entered the market in some US cities (abstract below). The results of this study are not really comparable to the the paper in PNAS, though. The methods are sound but I have the impression the authors pay too much attention to the statistical significance of the results and do not really discuss the magnitude of the effects of Uber entry on congestion. In any case, it's a good read. 

    Li, Z., Hong, Y., & Zhang, Z. (2016). Do Ride-Sharing Services Affect Traffic Congestion? An Empirical Study of Uber Entry. Available at SSRN:

    Sharing economy platform, which leverages information technology (IT) to re-distribute unused or underutilized assets to people who are willing to pay for the services, has received tremendous attention in the last few years. Its creative business models have disrupted many traditional industries (e.g., transportation, hotel) by fundamentally changing the mechanism to match demand with supply in real time. In this research, we investigate how Uber, a peer-to-peer mobile ride-sharing platform, affects traffic congestion and environment (carbon emissions) in the urban areas of the United States. Leveraging a unique data set combining data from Uber and the Urban Mobility Report, we examine whether the entry of Uber car services affects traffic congestion using a difference-in-difference framework. Our findings provide empirical evidence that ride-sharing services such as Uber significantly decrease the traffic congestion after entering an urban area. We perform further analysis including the use of instrumental variables, alternative measures, a relative time model using more granular data to assess the robustness of the results. A few plausible underlining mechanisms are discussed to help explain our findings.

    A good-looking video of the computer simulation model of the PNAS paper.

    Thursday, June 15, 2017

    Mexicans didn’t cross the US border. The border crossed them

    Carlos Goes pointed me to this short piece in The Economist:
    "... communities have proved more durable than borders. The counties with the highest concentration of Mexicans (as defined by ethnicity, rather than citizenship) overlap closely with the area that belonged to Mexico before the great gringo land-grab of 1848."
    For the most part, Mexicans didn’t cross the US border. The border crossed them.

    Wednesday, June 14, 2017

    Getting updates from Urban Demographics blog

    This week we have crossed the milestone of 5000 followers on Twitter. If anything, this means there are a lot of procrastinators out there. If you're not on Twitter but you would like to  procrastinate  receive automatic updates when there is a new blog post, there are two options:

    (1) You can subscribe to our RSS Feed in a reader . I'd recommend using Feedly. (2) Or you can get updates from our Facebook page.

    if you like this blog, recommend it to your friends. If you don't like this blog, recommend it to your enemies. That's also fine.

    Monday, June 12, 2017

    The people who keep us company throughout our life cycle

    Henrik Lindberg has put together this nice chart showing the people we spend the most time with throughout out life cycle. The data comes from the America Time Use Survey, and the the code to create this chart in R is available here. Thanks Steve Williams for the pointer.

    This might be a good moment to reflect about life.

    Friday, June 9, 2017

    Time-lapse: Nightfall over Los Angeles

    Nightfall, by Colin Rich. Remember to watch in high-definition full screen. Via Aaron Renn from Urbanphile.

    NightFall from Colin Rich on Vimeo.

    Wednesday, June 7, 2017

    The Fundamental Law of Road Congestion

    Duranton, G., & Turner, M. A. (2011). The fundamental law of road congestion: Evidence from US cities. The American Economic Review, 101(6), 2616-2652. Ungated version here.

    We investigate the effect of lane kilometers of roads on vehicle-kilometers traveled (VKT) in US cities. VKT increases proportionately to roadway lane kilometers for interstate highways and probably slightly less rapidly for other types of roads. The sources for this extra VKT are increases in driving by current residents, increases in commercial traffic, and migration. Increasing lane kilometers for one type of road diverts little traffic from other types of road. We find no evidence that the provision of public transportation affects VKT. We conclude that increased provision of roads or public transit is unlikely to relieve congestion

    This paper reminds of the Black Hole Theory of Highway Investment, which we posted about a while ago.

    Monday, June 5, 2017

    Making sense of smart cities

    Last year (2016), Tim Schwanen, James Palmer and I put together a lecture series around the topic of "Urban Mobilities in the Smart City", hosted at the Transport Studies Unit (TSU) at Oxford University.

    It was a great experience and I learned a lot from the speakers but also from the process of co-organizing the event. I would like to share here four papers that I've read back then and that I would recommend to anyone who wants to start a research on smart cities. These are quite influential papers so some of you might have read them already. Also, feel free to suggest in the comments some other publications you think have strongly contributed to the literature.

    image credit : techcrunch

    Thursday, June 1, 2017

    What makes a good post-doc application ?

    A heads up for those  unemployed  finishing their PhDs soon, by Martin Chalfie:

    Wednesday, May 31, 2017

    Visualizing the concept of prospective aging with R

    In two great papers published in Science and Nature, W. Sanderson and  S. Scherbov proposed a new way to understand population aging. Instead of focusing on the time people have lived, the authors take a prospective look at the number of years people are still expected to live.

    This concept of "prospective aging" is nicely summarized by Ilya Kashnitsky in a blog post:
    "The underlying idea is really simple – age is not static: a person aged 65 (the conventional border deliminating elderly population) today is in many aspects not the same as a person ages 65 half a century ago. Health and lifespan improved a lot in the last decades, meaning that today people generally have much more remaining years of life at the moment of being recognized as elderly by the conventional standards. Thus, Sanderson and Scherbov proposed to define elderly population based on the estimation of the expected remaining length of life rather than years lived. Such a refined view of population ageing disqualifies the alarmist claims of the approaching demographic collapse."
    If you're interested in the topic, I would highly recommend reading the whole post (and the papers, of course). Ilya brings not only a nice summary of the concept, he also presents some R scripts to create animated population pyramids to visualize prospective aging.

     Ilya Kashnitsky writes a great blog and twitter about demographic research and R more broadly, and I would highly recommend following his work online.

    Related Links:

    Tuesday, May 30, 2017

    Wednesday, May 24, 2017

    Urban Picture

    Sunday, May 21, 2017

    The impressive expansion of subway systems in China

    I have posted in the past a GIF that compares the expansion of the subway systems of Rio and Shanghai between 1979 and 2014. This is a bit embarrassing for Rio, for sure, but let's be honest. Pretty much any developing country and even the USA in their efforts to develop mass transport infrastructure pales in comparison to China. Needless to say that massive expansion of infrastructure like this usually comes at high social and environmental costs that should not be neglected.

    Peter Dovak (twitter) has created a new GIF that shows the expansion of subway systems in China between 1990 and 2020, giving a glimpse of the Chinese urban powerhouse. Peter has other great projects you might want to check out, including the Mini Metro Maps of the world.

    ps. I saw this on the Transportation Planning and Analysis Facebook group, via Gonçalo Correia

    Saturday, May 13, 2017

    Time-lapse: night-flight over Europe

    Great shot, by Thomas Pesquet.

    Wednesday, May 10, 2017

    Message of the Day

    Dedicated to a dear friend, Claudia Comberti. From London to the Amazon forest.

    Friday, May 5, 2017

    Changing relation between wealth and left-wing vote: Piketty's guess on the French elections

    I don't usually post about politics in the blog, but I had the chance to attend Thomas Piketty's presentation at the Marshall Lectures over the last two days and he dedicated a few minutes of his speech to talk about the 2017 French elections happening this weekend. 

    He presented these two slides, where he shows the changing relationship between wealth + education and left-wing vote in France. The slides show what is Piketty's guess on what is going to happen in the French elections.  Hi guess are the red lines in both charts, suggesting that Macron will win the election. I think I'll just leave this here, for the record.

    update after the elections: so, apparently, Piketty was correct.

    photos: by Rafael H M Pereira

    Thursday, May 4, 2017

    Urban Picture

    Street Chalking Games, New York city 1950

    credit: ?, via MicropolisNYC

    Wednesday, April 26, 2017

    Map of Population Density Lines in R

    If you are familiar with this famous Joy Division cover, you might remember that last year we shared a link that shows you how to reproduce the cover using R ggplot2. If you are a big fan of Joy Division and R, you should know that there is an R package just for that (by @mikefc).

    About three years ago in 2014, James Cheshire created the Population Lines Print, a stylized map using lines to show population density in the world. It uses roughly the same data visualization style used in the Joy Division cover. 

    credit: James Cheshire

    How can you create a nice-looking map like this? Ask no more. James has recently shared the R script and a bit of the history behind his mapHenrik Lindberg has also generously written a gist with a simple and reproducible code to create a map with the same style showing the distribution of the population density in Europe, using R and ggplot2.

    and you get this:

    credit: Henrik Lindberg

    UPDATE: Carson Sievert‏ shows how you can add two (2!) more lines of code to make this map interactive.

    Tuesday, April 25, 2017

    An unorthodox approach to spatial clustering

    I left a question on gis.stackexchange about an unorthodox approach to spatial clustering that came to my mind a couple of days ago. I would be glad to hear if you have any thoughts on this. If you have any comments/answers, this time I'll ask you to write them on the gis.stackexchange website.

    Monday, April 24, 2017

    There is a boom in bicycle research

    Although we don't know how the 'bicycle literature' has been growing relative to all publications in transport/mobility, there is a good sign there is boom in bicycle research! The method used by Jennifer to identify the publications is not supper systematic but it's insightful anyway. Jennifer's blog post is a quick and interesting read.

    credit: Jennifer Dill

    Thursday, April 20, 2017

    Quote of the day: programming

    Monday, April 10, 2017

    A glimpse into the future of autonomous vehicles

    Cesar Hidalgo (Twitter) has shared this mesmerizing video by People's Daily, China. It shows hundreds of autonomous robots sorting parcels in a warehouse of a Chinese delivery company.

    It makes you think about many things related the technology density of the Chinese economy and the coming changes in the labor market of China and beyond. The obvious thought that occurred to me, though, is how these warehouses can be thought as a super simplified beta-version of integrated systems of autonomous vehicles we might see in cities in 100 years form now... maybe 50.

    Wednesday, April 5, 2017

    Two new libraries for working with Spatial data in R

    A quick heads up for those interested in using R for spatial analysis and mapping data. There are two relatively new libraries you might want to check out:

    • The first one is the ggspatial library, created by Dewey Dunnington. ggspatial is a great package that makes it super simple to create maps using ggplot. It uses a single geom_spatial() for all types of spatial objects (polygons, lines, dots, etc.) and it dispenses the use fortify(), making things much faster.

    • Another library some of you might find useful is sf (as in simple features), created by Edzer Pebesma. This library makes it much faster to conduct several spatial operations, like reading/writing data, intersecting spatial objects, computing shortest distance matrices etc. The sf library is integrated with ggplot2 for creating maps with geom_sf() and it also makes it easy to connect to spatial data bases. This promises to be a real game changer for spatial analysis in R.

    Monday, April 3, 2017

    Saturday, April 1, 2017

    Google Self-Driving Bike

    This is from last year, but we can always use it on April 1st :)

    Wednesday, March 29, 2017

    On my way to Boston

    Hi all. I'm flying to Boston in the next few days to participate at the AAG conference.

    I'm very excited about this because I'll participate in a panel with Susan Fainstein and others. In the panel, I'll be talking about transportation equity and accessibility in the just city. My talk will be based on the 1st paper of my thesis and some future research questions on the topic.

    I will also be at the session 3650 presenting the preliminary results of the 2nd paper of my thesis, where I analyze the distributional impacts of the transport legacy of recent mega-events in Rio de Janeiro (Brazil) in terms of their impacts in inequalities in access to opportunities. The paper combines population census data with geolocated time-tables in GTFS format in order to conduct a before-and-after comparison of Rio's public transport system between 2014 and 2017. The paper examines how the newly implemented transport investments have reconfigured the catchment areas of the Olympic sports venues and of healthcare facilities by public transport and walking, looking specifically at how the population composition within those areas has changed in terms of income categories.

    The other papers of my PhD will focus on inequalities in accessibility to employment and educational opportunities, adding some new elements regarding methods and theoretical discussions. More info to come as I make progress on the research.

    ps. In case you're in Boston next week and would like grab a  coffee  beer, drop me line or a tweet.

    Saturday, March 25, 2017

    Creating an animated world map of life expectancy changes from 1950 to 2100 in R

    I've created this map after a couple of hours  procrastinating  testing the gganimate package in R, which makes it ridiculously simple to create this type animation in .gif or .mp4 format.

    The map shows how the life expectancy of each country has changed from 1950 to 2015 and how it is expected to increase up to 2100. It looks better in full screen, but it's still a bit clunky.

    I've also created a gist that shows how you can create this map yourself:

    Thursday, March 23, 2017

    cfp: special issue on informality in urban transport

    Heads up. The Journal of Transport Geography has opened a call for papers for a special issue on "Concepts and methods on informality in urban transport across world regions".

    Focus of the Special Issue:
    The special issue intends to close the gap. Building on a set of original papers, it seeks to establish an account of the state-of-the-art of which concepts and methods are applied for what topics/aspects of informality in urban transport, an in-depth review of selected specific methods and their application in the field and the identification of their strengths and limitations, and the identification of lessons and directions for future research on the subject. The Symposium positions a set of overarching questions:
    • How and how well do existing concepts and methods capture the phenomenon of informality in urban transport? What are they missing out? What is the promise of new /emerging technology in data gathering? What can be won by combining methods?
    • What are the strengths and the limitations of approaches in specific case study contexts but also across cases and contexts?
    • How can case study and experiential-based methodologies inform network-scale analyses in more conventional transport geography?
    • What methods help to transfer knowledge from the research community across to policy making?

    I saw this info on the new twitter account of the International Network for Transport and Accessibility in Low Income Communities, a research group recently created by Karen Lucas. You might wanna follow them.