-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebugging.do
More file actions
122 lines (75 loc) · 2.84 KB
/
debugging.do
File metadata and controls
122 lines (75 loc) · 2.84 KB
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
local aesthetic=10.1 //no meaning
local loop=`aesthetic'
foreach command in "if 10" noisily quietly {
`command' {
if `loop' == `aesthetic' { //functional
local command: di "if"
}
local loop = `loop' + 1 //divergence,emergence
if 0 { //background: local,if,update
/*
1. local macros -> `name'
2. if conditionals: aesthetics,functionality
3. update of `loop' macro value
*/
}
if 1 { //methods: macros,logfile,settings
timer on 1
global url https://data.nber.org/mortality/
global filename mort1959.dta
global logfile wk1.ph.340.700-`command'
cls
capture log close
log using ${logfile}.log, replace
set more off
version 15
noi di "`c(current_time)' `c(current_date)'"
timer off 1
}
if 2 { //results:data,year,save
timer on 2
forvalues i=1959/1961 {
use "${url}`i'/mort`i'", clear
noi di ""
noi di "# of deaths in `i'=`c(N)'"
noi di ""
save y`i', replace
timer off 2
}
}
if 3 { //conclusion:N as `i'->2017???
timer on 3
clear
forvalues i=1959/1961 {
append using y`i'
}
timer off 3
}
if 4 { //acknowledge:i=1959/1961 -> pilot
timer on 4
noi di "# of deaths: `c(N)' & # of variables: `c(k)'"
noi lookfor year
g deaths=1
preserve
collapse (count) deaths, by(datayear)
save twoway.mort.dta,replace
noi di "# of deaths: `c(N)' & # of variables: `c(k)'"
noi list
#delimit ;
line deaths datayear,
sort
ti("United States")
xti("Year");
#delimit cr
restore
noi di "# of deaths: `c(N)' & # of variables: `c(k)'"
timer off 4
}
if 5 { //reference:emerging,supersize.dta
save mort.dta, replace
}
noi timer list
timer clear
log close
}
}