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_dataset
in a folder calleddatasets
. We have written the code without global file paths assumingdatasets
is 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.py
creates 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.csv
as the input and returnsembeddings_avg.csv
andgravity_dist_avg.csv
as the outputs. covariate_construction.py
merges 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 withSynth
R
package to save .png image in the directory.synth_biannual_tables.R
- runs the synthetic control withSynth
R
package to print tables to theR
terminal.functions_conformal_012
- implements the inference method from Chernozhukov et al. (2021).- Running the synthetic control will require
R
version >= 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_dist
andgravity_var
toDistance.from.Mean
andmean_var
fromfonts_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.