-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdataset_construct_nber_options.py
169 lines (161 loc) · 11.8 KB
/
dataset_construct_nber_options.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
"""
NBER DATASET CONSTRUCT OPTIONS
"""
#-Dataset Configuration-#
#~~~~~~~~~~~~~~~~~~~~~~~#
#-Future Work: Check this is Consistent with pyeconlab definitions-#
DATA_DESCRIPTION = {
#-Country Datasets-#
'A' : u"A basic dataset that incudes AX and SITCR2 indicators and collapses data to a specified level maintaining initial countrycodes and productcodes as in the raw dataset, removes NES",
'B' : u"[A] except corrects HK-CHINA data from nber correction files",
'C' : u"A dataset that does not contain AX, adjusts HK-CHINA data, but does not adjust products or countries for intertemporal consistency",
'D' : u"A Dataset that does not contain AX or any non standard SITCR2 codes, adjusts HK-CHINA data, but does not adjust products or countries for intertemporal consistency",
'E' : u"A Dataset that does not contain AX and updates productcodes to be more intertemporally consisted, adjusts HK-CHINA data, but does not adjust countries for intertemporal consistency",
'F' : u"A dataset that does not contain AX and updates productcodes to be more intertemporally consisted, adjusts HK-CHINA data, and adjusts countries for intertemporal consistency",
'G' : u"A dataset that does not contain AX or any non standard SITCR2 codes, adjusts HK-CHINA data, and adjusts country codes for intertemporal consistency",
# 'H' : u"A dataset that does not contain AX and udpates productcodes to be more intertemporally consistent, adjusts HK-CHINA data, and adjusts country codes for intertemporaly consistency and drops non-complete countries (EXPERIMENTAL)",
# 'I' : u"A dataset that does not contain AX or any non standard SITCR2 codes, adjusts HK-CHINA data, and drops countries that are not intertemporally complete (EXPERIMENTAL)",
}
RAW_DATA_DESCRIPTION = {
#-Raw Dataset Descriptions-#
'RAW1' : u"Basic RAW dataset with iso3c countrycodes included and collapsed quantity disaggregation",
'RAW2' : u"Basic RAW dataset with iso3c countrycodes included, collapsed quantity disaggregation, and adjusts HK-CHINA data",
}
#-Data Option Definitions-#
DATA_OPTIONS = {
'A' : {
#-ProductCode Adjustments-#
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : False, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : False, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
#-CountryCode Adjustments-#
'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
#-Other Adjustments-#
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'B' : {
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : False, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'C' : {
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'D' : { #-!!-MAJOR-!!-#
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : True, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'E' : { #-!!-MAJOR-!!-#
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : True, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'F' : { #-!!-MAJOR-!!-#
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : True, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : True, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
'G' : {
'AX' : True, #Add a Marker for 'A' and 'X' Codes
'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
'drop_nonsitcr2' : True, #Removes Non-Official SITC Revision 2 Codes From the Dataset
'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
'intertemp_cntrycode' : True, #Recode Country Codes to be Intertemporally Consistent
'drop_incp_cntrycode' : False, #Drop Incomplete Intertemporal Countries
'adjust_units' : False,
'source_institution' : 'un',
'verbose' : True,
},
# 'H' : { #-!!-EXPERIMENTAL-!!-#
# 'AX' : True, #Add a Marker for 'A' and 'X' Codes
# 'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
# 'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
# 'drop_nonsitcr2' : False, #Removes Non-Official SITC Revision 2 Codes From the Dataset
# 'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
# 'intertemp_productcode' : True, #Compute an Intertemporal ProductCode
# 'intertemp_cntrycode' : True, #Recode Country Codes to be Intertemporally Consistent
# 'drop_incp_cntrycode' : True, #Drop Incomplete Intertemporal Countries
# 'adjust_units' : False,
# 'source_institution' : 'un',
# 'verbose' : True,
# },
# 'I' : { #-!!-EXPERIMENTAL-!!-#
# 'AX' : True, #Add a Marker for 'A' and 'X' Codes
# 'dropAX' : True, #Drops Products where Codes have 'A' or 'X'
# 'sitcr2' : True, #Adds an Official SITC Revision 2 Indicator
# 'drop_nonsitcr2' : True, #Removes Non-Official SITC Revision 2 Codes From the Dataset
# 'adjust_hk' : True, #Adjust Data to incorporate Honk Kong Adjusments provided by NBER
# 'intertemp_productcode' : False, #Compute an Intertemporal ProductCode
# 'intertemp_cntrycode' : False, #Recode Country Codes to be Intertemporally Consistent
# 'drop_incp_cntrycode' : True, #Drop Incomplete Intertemporal Countries
# 'adjust_units' : False,
# 'source_institution' : 'un',
# 'verbose' : True,
# },
}
RAW_DATA_OPTIONS = {
#-RAW includes NES, World etc. and Undertakes a Minimum of Changes to the Data to make it Comparable-#
'RAW1' : {
'adjust_hk' : False, #Adjust Hong Kong Data
'harmonised_raw' : True, #Construct Harmonised RAW Data File (No Quantity Disaggregation, Common Names)
#-Required Due to Script Logic Below-#
'intertemp_productcode' : False,
},
'RAW2' : {
'adjust_hk' : True, #Adjust Hong Kong Data
'harmonised_raw' : True, #Construct Harmonised RAW Data File (No Quantity Disaggregation, Common Names)
#-Required Due to Script Logic Below-#
'intertemp_productcode' : False,
},
}