<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Anand Sharma on Medium]]></title>
        <description><![CDATA[Stories by Anand Sharma on Medium]]></description>
        <link>https://medium.com/@anand2sharma?source=rss-ab30a9d6b8ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*YtOCH4ngS7nWSjTXEgSU_w.jpeg</url>
            <title>Stories by Anand Sharma on Medium</title>
            <link>https://medium.com/@anand2sharma?source=rss-ab30a9d6b8ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 20:56:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@anand2sharma/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Digital India Payments After Demonetisation]]></title>
            <link>https://medium.com/@anand2sharma/digital-india-payments-after-demonetisation-140f06906758?source=rss-ab30a9d6b8ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/140f06906758</guid>
            <category><![CDATA[digital-india]]></category>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[cashless]]></category>
            <category><![CDATA[narendra-modi]]></category>
            <category><![CDATA[payments]]></category>
            <dc:creator><![CDATA[Anand Sharma]]></dc:creator>
            <pubDate>Wed, 30 Aug 2017 01:47:00 GMT</pubDate>
            <atom:updated>2017-08-30T01:47:00.182Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever since India demonetised high value currency notes there has been significant push for using digital payment personally from Prime Minister Naredra Modi and GOI (Government Of India) itself. GOI has launched new initiative such as BHIM and renewed thrust on UPI along with several incentives to drive down cash economy and move toward less-cash economy if not cashless. Since RBI (Reserve Bank of India) <a href="https://rbi.org.in/Scripts/BS_PressReleaseDisplay.aspx?prid=39469">publishes</a> payment data monthly I thought of exploring it and see if there is any interesting pattern or behaviour that Indians exhibit while making digital payment.</p><h3>Load Data</h3><p>We will be using R for our analysis and GitHub for code hosting. RBI provides data in excel form so we will be using following libraries to load, transform and visualise our data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1a7a61f9da3045b3a7d1d39fa9ab989a/href">https://medium.com/media/1a7a61f9da3045b3a7d1d39fa9ab989a/href</a></iframe><p>Now we will load and merge all data in memory for further processing</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/260aef3a79f18f57bb630853b9ca2903/href">https://medium.com/media/260aef3a79f18f57bb630853b9ca2903/href</a></iframe><p>In above code we wrote a generic function to read excel files properly and performed some basic cleaning operation. As USSD volume and value both were too tiny for any meaningful comparison we have removed them from data. This is how our data looks now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*NsSsdvCxAS7kWSwOcKXcnw.png" /><figcaption>Untidy Data</figcaption></figure><h3>Ask Questions</h3><p>Awesome ! We got our first view of data now we need to understand it and frame questions that our data can answer us. I thought it would be great if we can get answers of followings:</p><ol><li>What is monthly and weekly distribution of payments?</li></ol><p>2. Distribution of each form within month for volume and values ?</p><p>3. Which form of payment has highest volume and value?</p><p>4. Which form has low value and low volume transactions?</p><p>5. Which payment mode has highest variability and which is consistent across all days?</p><p>6. What is distribution of transactions for individual day and in entire month?</p><p>Now that we know what questions to ask lets transform our data so that it can answer them.</p><h3>Data Transformation &amp; Cleaning</h3><p>Now we will use <a href="https://www.tidyverse.org/">Tidyverse</a> family of packages to transform and manipulate data into tidy form where each column will be a value and each row will be an observation.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1e91d506916181e6f26fc5e1daa00aed/href">https://medium.com/media/1e91d506916181e6f26fc5e1daa00aed/href</a></iframe><p>Here first we have identified what unique attributed our data has i.e. column and then transform existing data according to that. In above code first we merged all column into key — value pair except day and month as we need them as column and then separated them in mode, value and volume other columns that we identified earlier. This is how our data looks now</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*Q-108Y4Naun3LSEQKfsWIQ.png" /><figcaption>Tidy Data</figcaption></figure><p>Now we have our tidy data its time to clean it. We observe that value and volume are in two different unit i.e value is in billion whereas volume is in million. Shall we convert them into singe uniform unit for fair comparison? After some pondering i thought to leave it as is as we can use different aesthetics to show them and we will never compare volume and value directly as it does not make any data sense.</p><p>Next was to order months chronologically rather then any other ordering as it makes sense and help user grasp a view of scenario over time.</p><p>Finally there is no column on which we can visualise and compare our data so we will add a date and weekday column. To complete cleaning and transformation of data.</p><p>Below is code for that.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ee8e0e89639dc4101bf6569ae89acd07/href">https://medium.com/media/ee8e0e89639dc4101bf6569ae89acd07/href</a></iframe><p>This is our cleaned and transformed data which is ready for visualisation now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*T2kIbcwvAdEpom9LqYa0Ug.png" /><figcaption>Final Data</figcaption></figure><h3>Visualise &amp; Answer</h3><ol><li>What is monthly and weekly distribution of payments?</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9c93287fd4fbf7edd9ecb770b9ea2aa5/href">https://medium.com/media/9c93287fd4fbf7edd9ecb770b9ea2aa5/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-ybqE65XQ9byvhhFetJoqQ.png" /></figure><p>As expected there were over 30 million digital transaction in December as people were having cash crunch and as money supply got better volume started decreasing steadily. March saw highest value transaction as people buy lots of insurance policy and make significant investment for tax purposes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d79b16598d5c1c606a7daeb9628b6d4/href">https://medium.com/media/6d79b16598d5c1c606a7daeb9628b6d4/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gzEAVXgvEvppgbn0uTQHfA.png" /></figure><p>Here is an interesting pattern as volume are highest on Monday maybe retail customer prefers Monday of payments and business people prefer Friday as it has highest value transaction to settle all trades.</p><p>2. Distribution of each form within month for volume and values ?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6ca47ee90387d6853c00447ab2ef476/href">https://medium.com/media/c6ca47ee90387d6853c00447ab2ef476/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PtkfHh5FDJpZBYZZemfhTA.png" /></figure><p>Monthly distribution of all payment modes are consistent and there doesn’t seems to be any interesting pattern or outlier here.</p><p>3. Which form of payment has highest volume and value?</p><p>From monthly transactions by payment mode chart we can infer that POS(Point Of Sale) which includes both credit and debit card has highest volume understandably so, as infrastructure of POS was already in place before demonetisation. Whereas RTGS(Real Time Gross Settlement) has highest value as it caters to larger transactions of above 50000.</p><p>4. Which form has low value and low volume transactions?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/81313cbd5265cbdf51e251b6894551b0/href">https://medium.com/media/81313cbd5265cbdf51e251b6894551b0/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tQMSIUPOwL_b4JmqBlN9Hw.png" /></figure><p>Clearly without exception UPI has lowest number of transactions.</p><p>5. Which payment mode has highest variability and which is consistent across all days?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6ec128906ba4a320bc2d89a033e86172/href">https://medium.com/media/6ec128906ba4a320bc2d89a033e86172/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c9dEtddpqlvMjWcu9lJtQw.png" /></figure><p>As we can observe POS(Point Of Sale) is most consistent throughout month whereas newer and smaller forms such as UPI and IMPS is more volatile then rest of others.</p><p>6. What is distribution of transactions for individual day and in entire month?</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0c5797eebd6fd9255356530846e34235/href">https://medium.com/media/0c5797eebd6fd9255356530846e34235/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aCNASTu5iJ3qj25oKLLEJQ.png" /></figure><p>Again our earlier intuition is reaffirmed here that high volume transactions takes place early into week e.g. first Monday of April, second Monday of May, second Monday of July and third Tuesday of June are high volume transactions day.</p><p>For second part of our question:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3d32e6ea4f639c0f956732b13ab44926/href">https://medium.com/media/3d32e6ea4f639c0f956732b13ab44926/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SeMET3oAlj-IY0w6Lk8vBg.png" /></figure><p>Here an interesting pattern is visible as we reach end of the month there is spike in value in all months except April where we have dip in transaction value towards the end of the month.</p><h3>Learnings</h3><p>Its really interesting to have an insight on how India is going digital. Following are some of the interesting points that we established with Data:</p><ol><li>Huge volume pickup after demonetisation in December</li><li>People prefer making high volume transaction early in week and month while high value transactions takes place at weekend and monthend.</li><li>RTGS is most preferred for high value transactions, POS is at top for high volume transactions.</li><li>UPI and PPI are fastest growing mode of payment supported by apps such as BHIM, Paytm etc.</li><li>Monday is preferred for high volume transaction whereas Friday is preferred for high value transactions.</li></ol><p>Thanks for your time and if you like this please spread the love.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=140f06906758" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualising India’s biggest problem and its Solution]]></title>
            <link>https://medium.com/@anand2sharma/visualising-and-solving-indias-biggest-problem-a67a59d67523?source=rss-ab30a9d6b8ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/a67a59d67523</guid>
            <category><![CDATA[open-data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[india]]></category>
            <category><![CDATA[analytics]]></category>
            <dc:creator><![CDATA[Anand Sharma]]></dc:creator>
            <pubDate>Sat, 14 Jan 2017 02:40:21 GMT</pubDate>
            <atom:updated>2017-02-02T03:18:10.668Z</atom:updated>
            <content:encoded><![CDATA[<h4>by analysing 500 cities</h4><p>After <a href="https://medium.com/@anand2sharma/exploring-worlds-top-10-economies-growth-with-r-bfb5258e8c2a#.nbjiv03rs">exploring</a> worlds economy I thought I should explore something from <a href="https://data.gov.in/">data.gov.in </a>which hosts very interesting data on India and is provided by GOI. I searched there and found that data is available in multiple format but its spread around multiple files. Then I found <a href="https://www.kaggle.com/datasets">Kaggle Datasets</a> which had ready to analysed data on <a href="https://www.kaggle.com/zed9941/top-500-indian-cities/feed">Indian cities</a> by <a href="https://www.kaggle.com/zed9941">Arijit Mukherjee</a><strong> </strong>and decided to give it a shot to find out if there is some interesting pattern or correlation in data.</p><h3>Insight</h3><p>After exploration of this really beautiful data we will be able to identify and answer one of the biggest problem We India as a nation our facing today which is <strong>population </strong>backed up by government provided data.</p><p>So lets get our hands dirty with data, We will use <strong>R</strong> for our exploration:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3986b023cf02497bfd1921acdf0b8a13/href">https://medium.com/media/3986b023cf02497bfd1921acdf0b8a13/href</a></iframe><p>We will use <strong>ggplot2</strong> for plotting and <strong>dplyr</strong> and <strong>reshape</strong> for data manipulation. Next we will import data in memory and rename three columns to enhance our understanding of data.</p><h4>Observations</h4><p>On first analysis of data I had following observations:</p><ul><li>We have 493 cities and 29 states in our data</li><li>Literacy, population and sex ratio can provide some interesting insight when explored individually or in combination with other variables.</li><li>When we will visualise this data for states it wont look aesthetically good if we put full names of states on any axis. We should provide abbreviations for all states.</li></ul><h4>Questions</h4><p>What questions can we ask and get answered given our data:</p><ul><li><em>Which states and cities are more literate and which needs improvement?</em></li><li><em>Which are bottom 5 states that needs most improvement?</em></li><li><em>Which state and city has highest population of children&#39;s?</em></li><li><em>Does female literacy has any impact on child population?</em></li><li><em>What is the difference gap in literacy of males and females across states?</em></li><li><em>Is there any correlation between child sex ratio and literacy?</em></li></ul><h4>Data Transformation and Visualisation</h4><p>Now to add state abbreviation in our data we need to do some data manipulation:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8d1400cd1d6eee384a7247395664db3b/href">https://medium.com/media/8d1400cd1d6eee384a7247395664db3b/href</a></iframe><p>Here we have imported a CSV file that contains state name and state abbreviation, removed a column which we had no use of. Because we have to join this data frame into our main data frame (<strong>cities_data</strong>), there are some minor adjustment that we needed to do such as converting states name to upper case and changing state name according to main data to make join successful.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/912dad8eab50b252118cab8e8d040d33/href">https://medium.com/media/912dad8eab50b252118cab8e8d040d33/href</a></iframe><p><strong>Answers by Data</strong></p><p><em>Which states and cities are more literate and which needs improvement?</em></p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f30e394ff036af0b189727755541e55a/href">https://medium.com/media/f30e394ff036af0b189727755541e55a/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*kG9XKjHddOmbAFwv-G2Ucw.png" /></figure><p>Aizawl (98.80) from Mizoram is most literate city of India and Sambhal (49.51) from UP really needs to get its literacy levels up. Now lets look at states:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/04f5969543eaafc5c699f35ba87457cf/href">https://medium.com/media/04f5969543eaafc5c699f35ba87457cf/href</a></iframe><p>Because there are multiple cities from each state in data, We have to first group it and then summarise to visualise it.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cc3f9128a35f770f78822c586f4f0b42/href">https://medium.com/media/cc3f9128a35f770f78822c586f4f0b42/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ASCNTdmGdxOXisveYwDZw.png" /></figure><p>As you can see Mizoram (98.80) is most literate state and UP (79.29) has lots of work to do which is also most populous state of India with 20% of population. Followed by J&amp;K (79.86). One thing to note here is that only one 1 city from Mizoram was part of the data whereas 63 from UP and 3 cities of J&amp;K.</p><p><em>Which are bottom 5 states that needs most improvement?</em></p><p>We will consider those states as leggard whose mean literacy lies in below 25% of states average literacy. where 87.29 is national average and 83.78 is for bottom 25% of states.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/994e0df35c4837a3ba3b1c9141dbebdc/href">https://medium.com/media/994e0df35c4837a3ba3b1c9141dbebdc/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/698/1*gLS9yRkDzTnkioia7fAnGQ.png" /></figure><p>So UP, J&amp;K and Rajasthan tops the chart. I am also surprised to see Delhi with 83.65% literacy at 7th position.</p><p><em>Which state and city has highest population of children’s?</em></p><p>Now we want to discover which states has most children as percentage of total population.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1eed36f7bd145df194e3d6959b30aca2/href">https://medium.com/media/1eed36f7bd145df194e3d6959b30aca2/href</a></iframe><p>There may be some NA values when we summaries, group or join data frames so it is good practice to filter NA records before applying any visualisation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UHMVK5ty8N86KQIdpWICEw.png" /></figure><p>For the first time Bihar is on top of the list and Himachal Pradesh is last. What could be possible reason? Maybe Bihar has better Child and Pregnancy care facilities than other or just that recently it has surge in population? Curiously Himachal Pradesh ranks very high on literacy (94.67%) as compared to Bihar(80.86%).</p><p><em>Does female literacy has any impact on child population?</em></p><p>We all have this assumption that if parents are educated they won’t have more than 2 child at least. Lets confirm this intuition with our Data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/933b61b3986e21ae4b28e36725b611ee/href">https://medium.com/media/933b61b3986e21ae4b28e36725b611ee/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qaNvKte_r2ZPIbkQgd25lQ.png" /></figure><p>We have plotted Child Population on x-axis and total population on y-axis. Our scatter plot is sized by female literacy which means bigger the dots more literate female will be of that city. Higher the dots more will be child population. All bigger dots are below 1.25% of total population. Which confirms our assumptions to a large extent that literate women&#39;s tend to have fewer child&#39;s.</p><p><em>What is the difference in literacy of males and females across states?</em></p><p>Here we want to display both genders side by side for all states. But if you look at data there is not any gender column on which we can group our data and investigate. For doing that we will use <strong>Reshape </strong>library to manipulate our data in form which we can than visualise.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3542f18f01416805160fa337d7dedab4/href">https://medium.com/media/3542f18f01416805160fa337d7dedab4/href</a></iframe><p>Here we have used melt() function of reshape library to group data on gender.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LwF9jWSVFhZ9XGmRV0w_LA.png" /></figure><p>Interestingly Rajasthan has 17% of hug gap between male (89%) and female (72%) literacy followed by J&amp;K with 12% and UP with 10% literacy gap.</p><p><em>Is there any correlation between child sex ratio and literacy?</em></p><p>We want to explore if literacy improves child sex ratio or not i.e. whether boy child craving is only limited to cities where most of the literate people lives or its a countrywide phenomena.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/23e7f91b2b3e0e2ac9760004e4535079/href">https://medium.com/media/23e7f91b2b3e0e2ac9760004e4535079/href</a></iframe><p>Correlation between child sex ratio and literacy is 0.1346 which means correlation of the two variables was statistically non-significant and there isn’t any strong relationship between two variables.</p><p>Lets confirm its distribution by a graph:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T6TYv41xB3UuhbJcX48Avg.png" /></figure><p>Indeed our deduction of no correlation is true.</p><p>Thanks for your time and if you like this post please spread the love by clicking <em>heart</em>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a67a59d67523" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring worlds top 10 economies growth with R]]></title>
            <link>https://medium.com/@anand2sharma/exploring-worlds-top-10-economies-growth-with-r-bfb5258e8c2a?source=rss-ab30a9d6b8ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfb5258e8c2a</guid>
            <category><![CDATA[economics]]></category>
            <category><![CDATA[r]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[data-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Anand Sharma]]></dc:creator>
            <pubDate>Tue, 01 Nov 2016 01:56:15 GMT</pubDate>
            <atom:updated>2016-11-01T02:11:30.832Z</atom:updated>
            <content:encoded><![CDATA[<p>I have been curious about data and its applications for a while now and recently I decided to take the plunge. After lot of searching and reading stuff online I found this fantastic free <a href="https://www.udacity.com/course/data-analysis-with-r--ud651">course </a>by Facebook on Udacity to start my adventure with data. I am doing this post to remind my future self and anybody who wants to give exploratory data analysis a Go. Remember I am still a beginner and if you have any suggestions or improvements, you are Welcome :).</p><p>So after having gone through first 3 chapters of the course, Udacity gives an exercise where we have to pick any data of our choice from Gapminder and apply our skills that we have learnt so far. As I have some interest in economics and markets, I went ahead with “Economic growth over the past 10 years” data set.</p><p>Now first thing I needed to do was to get myself familiar with data and its structure. For that we will be using R to explore, understand and transform data. For those who are not familiar with R, It is an open source simple programming language to manipulate data with tons of library available for free. It has simple syntax so it should be readable even if you are not familiar with this language.</p><p>We will use two R packages, ggplot2 for creating graphs, reshape for data manipulation and RStudio for development.</p><p>So let’s get started:</p><p><strong>Exploration</strong></p><p>First thing we need is to get the data from <a href="https://www.gapminder.org/data/">Gapminder’s</a> website, Go there search for “Economic growth over the past 10 years”. The file is in excel format we need to convert it into CSV for manipulation. I used Google Docs for this.</p><p>So we got our CSV file now, it’s time to import it and have some fun with R.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/06c0e6bc8c8a7bc509837d0c398a415a/href">https://medium.com/media/06c0e6bc8c8a7bc509837d0c398a415a/href</a></iframe><p>Here First two statements install both the packages we need, next two loads the packages in memory for us. Every time we start RStudio, We have to reload all your dependencies even if they are already installed. Last statement imports our converted CSV file into memory for R to work with.</p><p>After getting data into R it was time to analyse and form some basic understanding of it. I had following observations:</p><ul><li>Provided data has observations for 188 countries over period 1960–2004</li><li>There were lots of small countries which were having missing data values throughout, as late as 1990</li><li>The data is in “Wide” format as there were 188 observation for 46 variables. One variable each for a year</li><li>We need to apply proper naming and transformation on column names</li></ul><h3><strong>Asking Questions</strong></h3><p>After initial observation and exploration it was time to think about what questions we can ask and get answered by available data? I thought We can address these ones:</p><ul><li>Which country has most consistent growth pattern?</li><li>Is there any country which was lagging behind initially and then saw rapid rise or vice-versa and Why (If data permits)?</li><li>Is there any outlier leader or leggard in growth?</li><li>Is there any correlation between the growth of two specific countries?</li><li>Any particular year or event which changed the economic growth trajectory of any country for decades?</li><li>Should We consider those countries which have lots of missing values?</li><li>Should We consider only top ten countries by GDP?</li></ul><p>After forming basic questionnaire, We have to transform raw data so we can compute and visualise it. Above listed questions were not form in any specific order, I just wrote them as they occur to me.</p><p>On going through all the questions I thought we should go for answering last two questions first. As they will change the data that we will be working with.</p><p><strong>Should We consider those countries which has lots of missing values?</strong></p><p>I thought significant missing values would affect data quality and later our model if we build one which ultimately affect prediction. I also thought of any other filling method such as replacing missing values and other solutions but decided not to include countries which has lots of missing values. Another factor was answer of our next question.</p><p><strong>Should We consider only top ten countries by GDP?</strong></p><p>As world’s top ten country by GDP contributed almost 68% to global GDP. I thought it would be better to just focus on top ten economies only as it would cut the noise and will correctly reflect the status of world economy.</p><p><strong>Data Cleansing &amp; Transformations</strong></p><p>Since we will focus only on top ten countries, we will need to transform our data to reflect that. But before that there are some issues with the data quality here such as names of the column, format of the data etc. That we need to address before plotting our data to get answers.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1273ae4673feff26a751eece38461f7b/href">https://medium.com/media/1273ae4673feff26a751eece38461f7b/href</a></iframe><p>Here we have subset the data only for top ten countries of the world by GDP.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ff90c96c001e2c0e167a3ceeb24fe863/href">https://medium.com/media/ff90c96c001e2c0e167a3ceeb24fe863/href</a></iframe><p>As you will observe data is in wide format i.e. there is one column each for every single year since 1960 till 2004. It would be been easy for us if we can have per year data for each country in row to help us visualise. For that we have used melt function of <strong>Reshape</strong> library which does it for us in single line of code. Next you will observe that all years have X appended with them such as 1960 is named as X1960. We need to remove this extra character as it will help R to perform any manipulations on dates we want. Also readability will be improved when we look at the data. Next two lines of code do this for us.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0d453c2612f6fce1d778545574bda54/href">https://medium.com/media/c0d453c2612f6fce1d778545574bda54/href</a></iframe><p>Here we update the names of column variables in data set and drop any duplicate values if there is any.</p><p>Finally we have our data ready to plot and discover insight from it. I choose box plot for charting as it will convey distribution and variability of data in one single graph.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b9704d88eb632ab2f58ed1a1c19d232c/href">https://medium.com/media/b9704d88eb632ab2f58ed1a1c19d232c/href</a></iframe><p>Here is the plot generated by <strong>ggplot</strong> for us. We can save any graph we create using library function <strong>ggsave</strong>().</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FCbQnvW2Jndn2gVn7QzF5g.png" /></figure><p>Then we can further investigate GDP growth by countries using following command.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a38f3e7dee34a1514fe2b2fe8837ee2e/href">https://medium.com/media/a38f3e7dee34a1514fe2b2fe8837ee2e/href</a></iframe><p>So we are done with data wrangling and visualisation part. Now let’s see if this newly gained perspective that we have got about our data can help us with some of the questions that we had initially.</p><p><strong>Which country has most consistent growth pattern?</strong></p><p>As you can see from the boxplot, United Kingdom’s growth has shortest candle length. By further investigating data it gets confirmed that its growth fluctuated between 1%-2.8% annually over period of time which is least of all countries.</p><p><strong>Is there any country which was lagging behind initially and then saw rapid rise or vice-versa and Why?</strong></p><p>To answer this question we need to investigate economies individually.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/79bdec9a5de4feb0dda6bb28d222d6ca/href">https://medium.com/media/79bdec9a5de4feb0dda6bb28d222d6ca/href</a></iframe><p>Here is the output of our plot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GFo_TB49MO0vi6eTbc7ug.png" /></figure><p>We can easily infer China as one which saw rapid rise after a slow start. Where as Japan is one the which started great, gained some momentum and then flattered in the end.</p><p><strong>Is there any outlier leader or laggard in growth?</strong></p><p>Clearly China was world leader in growth during 1960–2004 period.</p><p><strong>Is there any correlation between the growth of two specific countries?</strong></p><p>There seems to be some correlation between Japan and China but it is still our intuition. Lets confirm this with data.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/eb1ec05694d8dec54f629c91b097189c/href">https://medium.com/media/eb1ec05694d8dec54f629c91b097189c/href</a></iframe><p>Above code confirms growth trajectory over time for both the countries side by side. Below is generated graph.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9kL4-7PBWzkyKC8meqXpg.png" /></figure><p>As you can observe there is negative correlation between two countries. As China started to grow around late 60’s and 70’s at same time Japan started its never ending slide in growth.</p><p><strong>Any particular year or event which changed the economic growth trajectory of any country for decades?</strong></p><p>We can easily observe from first graph that Brazil, China, France, India, Italy and Japan are countries which has had that one impact year which changed their economic growth trajectory for decades or forever in some cases. Curious mind can also find out what were the event which triggered these changes but we will stay away from it for now. Following is the code that we will use to find out, What was the exact year for these countries. e.g. Japan</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d22d5aa29f4e1d33527f778e7b35da0c/href">https://medium.com/media/d22d5aa29f4e1d33527f778e7b35da0c/href</a></iframe><figure><img alt="" src="https://cdn-images-1.medium.com/max/891/1*tW8qk6BvR26AN2hMc1Tsmw.png" /></figure><p>For Japan, 1969 was inflection point in terms of growth. It was growing about 8% in that year but after that it fell off and never got back to those growth rates in its entire history.</p><p>For others it follows as</p><ul><li>Brazil: 1976</li><li>China: 1968</li><li>France: 1969</li><li>India: 1974</li><li>Italy: 1968</li></ul><p>As you can see 1967–1977 was the decade when all major world economy saw their fortunes changed upside down from being world leader to growth laggard and vice-versa.</p><p>So we have been able to answer all our curiosity and questions from data and that’s awesome because its <strong>unbiased</strong> and accurate. I know this article got little long and hope it was worth your time. Thanks for reading and keep crunching data, YAY!!</p><p>If you like it please spread the love.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfb5258e8c2a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>