=== Agglomeration_CBSA.sql ===
[[:File:Agglomeration_CBSA.sql.pdf|Agglomeration_CBSA.sql]] is the main SQL file that performs the overall data processing.
<pdf>File:Agglomeration_CBSA.sql.pdf</pdf>
=== File:AgglomerationAnalysis.do ===[[:File:AgglomerationAnalysis.do.pdf|AgglomerationAnalysis.do]] is the final Stata do file, which performs the analysis the builds the tables and regression specifications used in the paper.
<pdf>File:AgglomerationAnalysis.do.pdf</pdf>
=== Agglomeration_CBSA.sql===
[[:File:AgglomerationMaxR2.do.pdf|AgglomerationMaxR2.do]] performs the HCA regressions to select agglomeration counts for each MSA.
<pdf>File:AgglomerationMaxR2.do.pdf</pdf>
=== Cubic.py ===
[[:File:Cubic_py.pdf|Cubic.py]] solves the cubic estimation to select an agglomeration code for each MSA. It uses [[https://scikit-learn.org/stable/modules/linear_model.html sklearn.linear_model]].
<pdf>File:Cubic_py.pdf</pdf>
=== Geocode.py ===
[[:File:Geocode_py.pdf|Geocode.py]] uses the Google Maps Distance API to compute distances between locations.
<pdf>File:Geocode_py.pdf</pdf>
=== HCA.py ===
[[:File:HCA_py.pdf|HCA.py]] is the main Hierarchical Clustering Analysis script. It takes startup keys (coname, statecode, datefirstinv) and locations (latitude, longitude) for each CBSA-year as a record and returns (layer,cluster) for each record.
<pdf>File:HCA_py.pdf</pdf>
=== Hierarchy.py ===
[[:File:Hierarchy_py.pdf|Hierarchy.py]] is my modified version of Damian Eads' hierarchy.py, which is available as a part of the [[https://docs.scipy.org/doc/scipy/reference/cluster.hierarchy.html scipy.cluster package]].
<pdf>File:Hierarchy_py.pdf</pdf>
=== Hierarchy-InsertSnippets.py ===
[[:File:Hierarchy-InsertSnippets_py.pdf|Hierarchy-InsertSnippets.py]] contains just the snippets needed to modify [[https://docs.scipy.org/doc/scipy/reference/cluster.hierarchy.html hierarchy.py]]
<pdf>File:Hierarchy-InsertSnippets_py.pdf</pdf>
=== Schedule.py===
[[:File:Schedule_py.pdf|Schedule.py]] provides various schedule manipulation methods and the layer-cluster encoding scheme that works with https://docs.scipy.org/doc/scipy/reference/cluster.hierarchy.html scipy.cluster.hierarchy]].
<pdf>File:Schedule_py.pdf</pdf>