Reference no: EM132326021
Assignment - Data, Code, and Replication Instructions
Below we describe the raw data files and .do files used in creating the figures and calculations in our paper, "Learning to Coordinate: A Study in Retail Gasoline." As per AER policy, we provide the raw data and code for the analysis contained in the manuscript.
Data - The unzipped raw data file contains two folders:
Prices: contains raw daily station-level prices for the period of January 3, 2001 to December 31, 2015.
- The file names in the Prices folder are all formatted as FuelWatchRetail-MM-YYYY.csv
- These data were downloaded from the Fuelwatch historical data archive in August 2017.
TGP: contains the raw daily wholesale terminal gate price (TGP) for Perth for the period of December 19, 2012 to December 31, 2015
- The file name for the raw TGP data is tgpmin.csv, which is the minimum of each day of the terminal gate price across Western Australia's 6 terminal gates.
- These data were downloaded from the Fuelwatch historical data archive in August 2017.
Code - The unzipped code zip yields the following five Stata .do files:
MakeData1_RawPrices.do
- Merges together all of the raw retail price data from Fuelwatch
- Input: retail price files (FuelWatchRetail-MM-YYYY.csv) and wholesale price files (tgpmin.csv)
- Output: Stata-formatted data files fw_ulp_raw.dta and tgp.dta
MakeData2_PriceVars.do
- Formats all dates and strings, constructs all the price cycle and margin-related variables throughout the paper, mergers the retail price data and wholesale TGP price data. The outputted data file is the sample used for the analysis throughout the paper.
- Input: fw_ulp_raw.dta and tgp.dta
- Output: fw_ulp_samp.dta
- Redundant fw_ulp_raw.dta and tgp.dta files are deleted at the end of the code
Section3_Facts.do
- Creates all the figures and conducts all the calculations in Sections 2 and 3 of the paper
- Input: fw_ulp_samp.dta
- Output: fig1_cycle.pdf, fig2i_dow.pdf, fig2ii_length.pdf, fig3_cuts.pdf, fig4i_pricecost.pdf, fig4ii_margin.pdf
Section4_Initiate.do
- Creates all the figures and conducts all the calculations in Section 4 of the paper
- Input: fw_ulp_samp.dta
- Output: fig5i_lead_jan2011.pdf, fig5ii_lead_jan2013.pdf, fig6i_dow_BP.pdf, fig6ii_dow_Caltex.pdf, fig7i_jump_wed.pdf, fig7ii_jump_thu.pdf, fig8i_experiment1.pdf, fig8ii_experiment2.pdf, fig9_cuts_dp2.pdf
Section5_Margins.do
- Creates all the figures and conducts all the calculations in Section 5 of the paper
- Input: fw_ulp_samp.dta
- Output: fig10_margin_cycle.pdf, fig11i_pdiff_wed.pdf, fig11ii_pdiff_thu.pdf, fig12_marg_BP_wed.pdf, fig13i_perr_thu.pdf, fig13ii_perr_wed.pdf, fig14i_dp_perr2.pdf, fig14ii_dp_perr1.pdf, fig15_marg_thu.pdf, fig16_margin_bottom.pdf
Replication - Here are the steps to replicating the paper:
1. Download and unzip the data and code zip files.
2. Update the main directory, data directory, and output directory at the top of each of the following files: MakeData1_RawPrices.do, MakeData2_PriceVars.do, Section3_Facts.do, Section4_Initiate.do, Section5_Margins.do
a. At the top of each of these .do files, the main, data, and output directors are defined as local macros "dir", "datdir", and "outdir"
b. You need to change these local macros for the directories such that they align to the desired main, data, and output directory on your computer.
i. Below is an example snap shot of the code where these are defined.
ii. Double-check all directories at the top of all .do files as there are small differences with MakeData1_RawPrices.do and the other 4 .do files.
3. With the data and code downloaded and the directories updated, run the code in the following order:
a. MakeData1_RawPrices.do
b. MakeData2_PriceVars.do
c. Section3_Facts.do
d. Section4_Initiate.do
e. Section5_Margins.do
By running steps 1-3, you will reproduce all the figures in the paper which contain the main results. The explicit calculations cited throughout the text that complement the figures are conducted within the Section3_Facts.do, Section4_Initiate.do, and Section5_Margins.do files. See the code in these .do files and extensive comments therein for details on these calculations.
Attachment:- Assignment Files.rar