Skip to content

Public repository for replicating the Master's Thesis

License

Notifications You must be signed in to change notification settings

andreas-andersen/Thesis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Master's Thesis Replication Code

GitHub release (latest by date) GitHub release date

Run everything through main.R and make sure to set the initial parameters correctly. The script requires the download and storage of ca. 1.2 GB of data, so choose working directory accordingly.

Prerequisites

R packages:

  • data.table
  • lubridate
  • readxl
  • RStata
  • tidyverse (>=1.3.1)
  • Downloading latest data from the Comtrade database through the parameter comtradeDownloader <- TRUE requires the ComtradeDatabaseDownloader package and a premium site license subscription.

Stata packages:

Parameters

wrangle <- TRUE
Will tell the script to run through the downloading and wrangling steps. If set to FALSE, the script will download an archived, completed dataset. The file was archived at 28 April 2022.

comtradeDownloader <- TRUE
Will tell the script to use the ComtradeDatabaseDownloader package to extract the latest available data from Comtrade. If set to FALSE, the script will download an archived version extracted at 27 April 2022.

WARNING!
Downloading a fresh dataset from Comtrade will require around 2 hours to complete. The connection might also fail, which requires you to re-run the script. The downloader does have a backup system which means you do not have to start re-downloading everything.

comtradeToken <- ""
If the above parameter is set to TRUE, input a valid Comtrade API token here. See the ComtradeDatabaseDownloader repository for further details.

options("RStata.StataPath" = "\"C:\\Program Files\\Stata17\\StataSE-64\"") Used to set the path to the Stata executable installed on your system. Optionally, you can use the chooseStataBin() function. See the RStata repository for further details.

options("RStata.StataVersion" = 17)
Assign the version number of your Stata installation

Output

9 regression output tables, saved in the standard Stata .smcl format.

Screenshot

About

Public repository for replicating the Master's Thesis

Resources

License

Stars

Watchers

Forks