-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean_tsi.log
77 lines (58 loc) · 2.6 KB
/
clean_tsi.log
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
___ ____ ____ ____ ____ (R)
/__ / ____/ / ____/
___/ / /___/ / /___/ 16.1 Copyright 1985-2019 StataCorp LLC
Statistics/Data Analysis StataCorp
4905 Lakeway Drive
College Station, Texas 77845 USA
800-STATA-PC http://www.stata.com
979-696-4600 [email protected]
979-696-4601 (fax)
6-user Stata network perpetual license:
Serial number: 501606204656
Licensed to: Miklos Koren
Central European University
Notes:
1. Stata is running in batch mode.
2. Unicode is supported; see help unicode_advice.
. do clean_tsi.do
. import delimited "input/respect-trade-similarity/TC_INDEX_EXP_.csv", clear
(20 vars, 7,056 obs)
.
. rename declarant iso2_o
. rename partner iso2_d
.
. reshape long tci_, i(iso2_o iso2_d) j(year)
(note: j = 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 201
> 4 2015 2016 2017)
Data wide -> long
-----------------------------------------------------------------------------
Number of obs. 7056 -> 119952
Number of variables 20 -> 5
j variable (17 values) -> year
xij variables:
tci_2001 tci_2002 ... tci_2017 -> tci_
-----------------------------------------------------------------------------
.
. drop v1
.
. gen iso2_od = cond(iso2_o <= iso2_d, iso2_o, iso2_d) + cond(iso2_o >= iso2_d,
> iso2_o, iso2_d)
.
. sum tci_ if iso2_o == "HU" & iso2_d == "DE" & year == 2017
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
tci_ | 1 1.305184 . 1.305184 1.305184
. sum tci_ if iso2_o == "DE" & iso2_d == "HU" & year == 2017
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
tci_ | 1 .814422 . .814422 .814422
. sum tci_ if iso2_od == "DEHU" & year == 2017
Variable | Obs Mean Std. Dev. Min Max
-------------+---------------------------------------------------------
tci_ | 2 1.059803 .3470208 .814422 1.305184
.
. save "temp/trade-similarity-clean.dta", replace
(note: file temp/trade-similarity-clean.dta not found)
file temp/trade-similarity-clean.dta saved
.
end of do-file