Showing posts with label world. Show all posts
Showing posts with label world. Show all posts

Tuesday, November 3, 2015

Continental Language Diversity

Since language data provides for the demonstration of many visualization techniques, I thought of using another set showing official languages spoken across continents using a new visualization in the "UpSetR" package.  The graph can be used for comparing sets of data numerically.  It provides an easier way to understand data for something like a Venn diagram more quantitatively.  Whereas the appeal of Venn diagrams is in their aesthetic, they do not provide understanding for the numeric value of sets when the sets reach a number that is visually challenging to interpret

Displaying the grouping of languages by continent was one way I thought to illustrate the use of the "UpSetR" package.  The data limits each country to one primary language.  The countries are then grouped into continents based on their location.  Below we can see the different continents and respective bar graphs associated with a continent or a set of continents.  The bar graph on the left side (y-axis) measures the number of languages in each continent.  The bar graph at the top (x-axis) measures the number of occurrences for each set of languages seen in the filled circles.  So each filled dot or set of dots represent a set or grouping of languages. 



For instance the red dot indicates 27 different languages in Europe that only occur in Europe, making it seemingly the most diverse in terms of official languages spoken.  The yellow dot set represents 2 languages that are spoken in countries located on 5 different continents (any guesses?*).  This graph does not capture the many different languages spoke in different countries but only the "lingua franca" associated with a continent.  For instance, Africa though linguistically diverse has as official status languages from the colonial-era, thus showing above a lack of diversity.

Alternatively we can see the transposition of this graph below.  Here we see the size of the intersects is small (because we are now considering continent intersects of which there are 1 for each continent).  Guessing the continents for this graph is perhaps a bit easier than guess the different languages for each continent above.



For those having data whose organization is in sets, visualizing sets in this way allows for various dimensions of data to be understood in a way not captured by other visualizations.  This tool for this particular language data set is an interesting view on official language use across continents.  The data used for these graphs is shown below.

The very few lines of code it took to make these graphs is available here.  Much thanks to the developers of this package!

*English and French


rows Africa Antarctic Asia Europe North.America Oceania South.America Countries
1 Albanian 0 0 0 1 0 0 0 1
2 Arabic 1 0 1 0 0 0 0 17
3 Armenian 0 0 0 1 0 0 0 1
4 Azerbaijani 0 0 1 0 0 0 0 1
5 Belarusian 0 0 0 1 0 0 0 1
6 Bosnian 0 0 0 1 0 0 0 1
7 Bulgarian 0 0 0 1 0 0 0 1
8 Catalan 0 0 0 1 0 0 0 1
9 Croatian 0 0 0 1 0 0 0 1
10 Czech 0 0 0 1 0 0 0 1
11 Danish 0 0 0 1 0 0 0 1
12 Dutch 0 0 0 1 1 0 0 3
13 English 1 0 0 1 1 1 1 39
14 Estonian 0 0 0 1 0 0 0 1
15 Filipino 0 0 1 0 0 0 0 1
16 Finnish 0 0 0 1 0 0 0 1
17 French 1 0 0 1 1 1 1 22
18 Georgian 0 0 0 1 0 0 0 1
19 German 0 0 0 1 0 0 0 4
20 Greek 0 0 0 1 0 0 0 2
21 Heard 0 1 0 0 0 0 0 1
22 Hebrew 0 0 1 0 0 0 0 1
23 Hindi 0 0 1 0 0 0 0 1
24 Hungarian 0 0 0 1 0 0 0 1
25 Icelandic 0 0 0 1 0 0 0 1
26 Indonesian 0 0 1 0 0 0 0 1
27 Italian 0 0 0 1 0 0 0 2
28 Japanese 0 0 1 0 0 0 0 1
29 Khmer 1 0 0 0 0 0 0 1
30 Korean 0 0 1 0 0 0 0 2
31 Lao 0 0 1 0 0 0 0 1
32 Latvian 0 0 0 1 0 0 0 1
33 Lithuanian 0 0 0 1 0 0 0 1
34 Malay 0 0 1 0 0 0 0 1
35 Maltese 0 0 0 1 0 0 0 1
36 Mandarin 0 0 1 0 0 0 0 1
37 Norwegian 0 0 0 1 0 0 0 1
38 Persian 0 0 1 0 0 0 0 1
39 Polish 0 0 0 1 0 0 0 1
40 Portuguese 1 0 0 1 0 0 1 7
41 Romanian 0 0 0 1 0 0 0 1
42 Russian 0 0 1 0 0 0 0 2
43 Slovak 0 0 0 1 0 0 0 1
44 Slovenian 0 0 0 1 0 0 0 1
45 Spanish 1 0 0 1 1 0 1 22
46 Swahili 1 0 0 0 0 0 0 1
47 Swedish 0 0 0 1 0 0 0 1
48 Thai 0 0 1 0 0 0 0 1
49 Turkish 0 0 1 0 0 0 0 1
50 Ukranian 0 0 0 1 0 0 0 1
51 Vietnamese 0 0 1 0 0 0 0 1

Wednesday, June 17, 2015

Language Difficulty and Diversity

*For R users not interested in the post but the code, a markdown file is available on github.  Thanks to Zuguang Gu and Bob Rudis for the 'circlize' and 'waffle' packages respectively.

I've been studying Arabic for about 10 months now and had some thoughts that I wanted to post about.  It's challenging, but I didn't know how challenging it was exactly when compared to other languages even though I knew it was on the more challenging end of the spectrum.  Turns out someone has measured (or attempted to) the amount of "class time" a native English speaker would need in order to learn a language.  In general, I've found my language ability improves most when I complement time in the classroom with time practicing with native speakers (which I think would be a more useful measure of time in tandem with "class time").

The data for the chord diagram below was retrieved from a language wiki site that used a study from the Foreign Service Institute.  The number of class hours for each of these languages communicates more a scale of difficulty than the exact number of hours it would take to speak a language (as not all learners are equal).  In general, this seemed to be a pretty comprehensive list of world languages so I thought it could look nice in a chord diagram.



From my own experience, I've been studying for about 10 months.  Not intensively perse, but about 6 hours per week along with conversation practice I have on my own.  Which means if I miss a few weeks I'll have logged about 300 class hours at a year.  Which is kind of disappointing considering I supposedly need 2,200 class hours!  I think these numbers are actually REALLY conservative but it does set some sort of benchmark for difficulty when comparing languages for English speakers.  I'm conversational now and feel comfortable with the language (though by no means fluent) after about 300 hours.  Which as a side note is why I think being immersed would decrease the amount of class time above dramatically.  

So, in learning Arabic and spending a supposed 2,200 hours studying it, how many more people can I actually communicate with?  Well, a lot more.  But in terms of world population I was surprised at the percentage of people who accounted for the top 5 most spoken languages (this includes Arabic).  I honestly had no idea language was quite this diverse (in that the top 5 languages comprise 35% of the world's languages, thought it would be more but that's just me).  Furthermore, if we get into dialects these percentages decrease further.  

Link to data

In real terms though, being able to speak with millions of additional people is fantastic and I would encourage all to pursue such an endeavor.  As for measuring my ability to communicate globally in percentage terms perhaps viewing language learning in the context of world language use is a scale reserved for those with unique skills in language acquisition.


Sunday, October 26, 2014

Syrian Refugee Informal Settlement Animation

This is an animation of the growth in Syrian refugee informal camp settlements in Lebanon over the past several years.  You can see from the .gif that the growth was most dramatic in terms of the number of settlements in the Summer of 2013.  The border has recently been closed and the number of additional settlements you can tell has dramatically decreased (opening in new window may be better for viewing).   



This was inspired by a much cooler animation by Nathan Yau of Walmart/Sams club store locations over time.  But this was my best attempt using what I knew in R, code here.  Special thanks to Kay Cichini for his helpful examples/tips and Yihui Xie for creating the awesome 'animation' package.

Tuesday, September 30, 2014

Syrian Refugee Settlement Clinic Locations

Previously I posted about the location of refugee settlements and how that had grown in density over time as well as in numbers.  As many NGOs and non-profits work in the area, they are providing much needed assistance to the people living around the Zahle area.  I wanted to look at the area again because of the breath of the crisis with Syria and the potential long-term locating of Syrians in Lebanon.  Services such as clinics have been established in these camps, which may or may not have taken into account the ability to service refugees (such planning considerations may not be possible in these circumstances) at optimal locations.  For long-term planning these are more important considerations by whomever the governing body for these settlements becomes.

Below is a map of settlement locations in the Zahle district provided by the UN Syria Data Portal.  Each point represents multiple tents in the settlement.


The overall consideration for clinic location will be on the basis for the level of service per person.  Based on a general criteria of having 1 clinic per 15,000-20,000 people, we can allocate about 4 clinics to the area.  The method(s) to determine these locations utilized both kmeans method of determining mean point in a cluster and a location analysis algorithm that considers the weights of points for determining a location (special thanks to the author(s) of orloca, kmeans, and the always helpful ggplot2 packages in R).

For these purposes latitude and longitude of tent settlement locations are the most helpful.  Here the settlements or points are colored according to the population of that settlement.


As you can see, some settlements hold many more people than others and the average settlement is about 187 people (again we're talking many tents per settlement).  Since the distribution of people in settlements is not equal we consider the "weight" (settlement population) for each point when determining a clinic location.  



The clinics are located most closely to those settlements with the highest number of people.  In the central Zahle area, these locations are about in the middle from a Latitude standpoint.  Other locations are perhaps less intuitive if the population of settlements were not considered.  Obviously with more clinics these points would change, but this is considered a minimum service level.

Using only this method to determine the location of a clinic would be problematic from the standpoint of what is actually on the ground with reference to street access or other local contingencies.   Planning for medical facilities is more of an exercise for long-term planning considerations than emergency or relief medicine which may have more short-term goals such as providing care at all.  Starting with taking into account the number of people being serviced and their location are important considerations as these camps become potentially longer-term obligations.

Those interested in the R code can find it here.

Thursday, July 10, 2014

Syrian Refugee Density in Lebanon

I've done a few posts on Syria and have used data provided by the UNHCR for different analysis or visualization.  There are several links on their Syrian refugee data portal that communicate the breadth of this crisis numerically and visually.

One such link had the locations of settlements in Lebanon and the number of people in each settlement.  This information is undoubtedly helpful for coordinating the location of services within camps and in general tracking how they grow.  I was interested in seeing the growth of these camps, where and during what time periods the most growth is seen.

Below is a map of the country (or most of it) showing where all the tents are located that have been documented by the UNHCR.  Overlaid is a density plot communicating the concentration of structures (tents) with the number of people housed per structure.


The concentration of settlements has clearly been just outside of a town called Zahle.  If we look more closely at Zahle we can more clearly see the number of people per tent in this settlement.  On average across Lebanon there are over 6 people per tent based on this UNHCR dataset, some as high as 12.



If looked at year by year, we can see how during different years this area was settled more heavily.  2013 was a year where a significant amount of tents were constructed or setup.  


No doubt this data is being used to coordinate the location of different public facilities such as clinics, etc.  Data such as this provided by UNHCR serves burgeoning communities with much needed information in how to setup a town or "plan" for how this settlement could be organized or mitigated differently.  The code for this data and graphs, or at least most of it is available on my Github account.  

Wednesday, April 30, 2014

Syrian Refugee with googleVis

In a previous post I showed the timeline of refugees leaving Syria for other countries.  The number of refugees leaving Syria is remarkable.  Understanding the strain this presents on countries is difficult to grasp.  Below I've attempted to visualize the population and proportion of refugees each of these countries hosts.  The tree map below shows the number of refugees (color:  red (lower) - green (higher) ) when compared between countries and the relative size of the host country (population) being represented by square size in the plot.  To the right of the tree map is a sankey diagram showing the relative volume of refugees in different countries in different times.  Notice how the volume to Lebanon increases dramatically from 2012 to 2013.

Though the number of refugees would strain any countries' economy, Lebanon is experiencing a unique proportion of the burden in this regard.  The number of refugees has had a considerable impact on the overall population percentage of the country.  The weight of hosting this many refugees is particularly straining to Lebanese laborers, rent prices, and other resources of the country.  



Tuesday, March 11, 2014

Syria Timeline

The UNHCR has provided a portal for tracking when refugees have left Syria and where they have gone.  The display of data in the graph below is in no way endorsed by the UNHCR, but was aggregated from their portal


As seen in a previous post, neighboring countries and specifically Lebanon has played a significant role in the process of relocating refugees.  The flow of people to these countries over time is remarkable considering that the demographics of most refugees entering neighboring countries, over 50% of the refugees are under the age of 18 (validity of this number also available at the UNHCR portal).  The chart below is interactive, but set to a setting that shows the growth over time of refugees from Syria moving to other countries.  You may notice the specific months where this spikes as well.  The data from the portal began in 2011 for the countries being tracked, and at that point some countries were already facilitating camps or other accommodations for Syrian refugees.














Monday, March 10, 2014

Lebanon shouldering Syria


The crisis that is Syria has had an incredible regional affect geopolitically, economically, and has required a significant response in humanitarian aid.  As the mass evacuation has occurred, surrounding countries are found hosting thousands of people, many of them children.  The UNHCR (United Nations High Commissioner for Refugees) has setup an inter-agency portal for tracking where refugees are going in the region.  Keep in mind, these people they are tracking are those that have registered with the UN.  It's safe to assume for one reason or another that many people in fact do not register.  Those that have registered and the approximate number of those that haven't total the "Total Persons of Concern" figure that the UNHCR puts out.  Below is a map that shows the "Total Persons of Concern" number with the number of persons indicated by the circle size in each city they are located.




You may notice that Turkey hosts the most refugees in one location, albeit there are many different camps in Turkey but that is not portrayed on the UNHCR website.  The camps hosting the refugees vary in their funding, some from the UN and some from the country itself.  Refugees in Lebanon seem to be hosted in four different cities as indicated by the UNHCR.  Lebanon also hosts the most Syrian refugees out of any country.



A couple remarkable things about the Lebanon's role with Syrian refugees.  First, the country itself has just over 4 million people.  Again, according to the numbers retrieved from UNHCR, there are about 1 million Syrian refugees (persons of concern) living in Lebanon.  That means 1 in 4 people in Lebanon are Syrian refugees.  Let's look at these numbers a different way and consider comparable US cities (just so we can have a comparison to understand the gravity of these numbers).




Keep in mind all the different needs for these populations in the US.  Then imagine facilitating these needs in refugee camps...simply staggering.