advaitmoharir / Coding-Samples

Sample code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Coding Samples

The page below describes the data used in the three sample codes in this repo, and what the code does.

Trade Decomposition.R

The main purpose of the code is to implement the decomposition of India's merchandise into three parts: Relative Absorption, Relative Import Intensity, and Terms of Trade. There are two sample visualizations: a periodwise decomposition table showing the contribution of each term, and a graph showing evolution of each component over time.

Text Analysis.R

Using four sample texts written by four classical economists - David Ricardo, Adam Smith, Karl Marx and John Stuart Mill, I use two techniques of text analysis namely, tf-idf and topic modelling to identify common themes across their works. The code extracts the raw book files, cleans them, implements the two techniques, and visualizes the output.

Chalfin McCrary Replication.R

I extend the Chalfin- McCrary dataset on police employment and crime (1960-2010), till 2019 to undertake a long replication of their analysis. The authors identify two sources of data for police employment, UCR and ASG. In this file, I extend the data for both these variables, by cleaning the raw data, and preparing it for further inference.

About

Sample code


Languages

Language:R 97.6%Language:HTML 1.6%Language:CSS 0.9%