This repo contains the codes to conduct causal analysis of merger using font embeddings created by fontnet in https://github.com/ericschulman/fontnet. Refer to Han et al. (2020) for details of the merger analysis.
- The data for this anaylsis come from the
main_datasetin a folder calleddatasets. We have written the code without global file paths assumingdatasetsis saved outside of this folder, i.e.,
fonts_project
└───fonts_causal_analysis
└───datasets
│ └─── raw_pangrams
│ └─── crop7_test
│ └─── crop7_train
│ └─── main_dataset
│ │ │ Style Sku Family.csv
│ │ │ ...
└───models
└───logs
└───fontnet
- Running
Gravity_Dist.pycreates the gravity distance measure. This file is computationally intesive to run and takes about 24 hours on relatively weak hardware, i.e., I5-6260U CPU @ 1.80GHz × 4 and 16 GB RAM. It takesembeddings_full.csvas the input and returnsembeddings_avg.csvandgravity_dist_avg.csvas the outputs. covariate_construction.pymerges the other relevant data into the synthetic control. It also computes the other distance measure, i.e., the distance from Averia, which is denoted asDistance.from.Mean.- The resulting file is called
fonts_panel_biannual_new.csv.
synth_biannual_plots.R- runs the synthetic control withSynthRpackage to save .png image in the directory.synth_biannual_tables.R- runs the synthetic control withSynthRpackage to print tables to theRterminal.functions_conformal_012- implements the inference method from Chernozhukov et al. (2021).- Running the synthetic control will require
Rversion >= 4. We ran the code on Ubuntu 18.03. - The code is currently written to produce tables for the gravity distance measure. To use the distance from Averia, you can modify lines 60 and 71 with the appropriate variables i.e. change
gravity_distandgravity_vartoDistance.from.Meanandmean_varfromfonts_panel_biannual_new.csv.
The codes and the dataset (separately shared) for this repository are protected by the Creative Commons non-commerical no-derivative license.