-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfert1.ado
75 lines (59 loc) · 2.22 KB
/
fert1.ado
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
capture program drop fert1
*! fert1 v1.1 10feb2019
program fert1
version 15.1
args path1 path2
global project_dir= "`path1'"
global working_dir= "`path2'"
***************************************************
*****************_REFORMAT PATHS TO_***************
****_ADD A TRAILING '\' TO PATH IF NOT PRESENT_****
*******_AND THEN REPLACE ALL '\' WITH '/'_*********
***************************************************
if usubstr("${project_dir}",(ustrlen("${project_dir}")),1) != "\" {
global project_dir="${project_dir}"+"\"
}
if usubstr("${working_dir}",(ustrlen("${working_dir}")),1) != "\" {
global working_dir="${working_dir}"+"\"
}
global project_dir = subinstr("${project_dir}","\","/",99)
global working_dir = subinstr("${working_dir}","\","/",99)
global project_dir = strltrim("${project_dir}")
global working_dir = strltrim("${working_dir}")
cd "${project_dir}"
***************************************************
***************_END REFORMATTING OF PATHS_*********
***************************************************
***************************************************
*****_CHECK NECESSARY ADO FILES ARE INSTALLED_*****
*****_add other packages below e.g. spmap etc_*****
***************************************************
foreach package in fs grstyle {
capture which `package'
if _rc==111 ssc install `package'
}
***************************************************
******************_END ADO CHECK_******************
***************************************************
***************************************************
***********_RUN THE VARIOUS DO FILES_**************
***************************************************
do "prepare_birth_files.do"
cd "${project_dir}"
do "prepare_1st_birth_files.do"
cd "${project_dir}"
do "mediandates.do"
window stopbox note "You need to open outputdata.xlsx, force the recalculation of" /*
*/ "the sheet, and allow the data table to update before proceeding." /*
*/ " " "Press OK only once you are certain that this has been done."
cd "${project_dir}"
do "excel_to_stata_graphs.do"
cd "${project_dir}"
do "parity_nomore.do"
cd "${project_dir}"
do "final_graphs.do"
cd "${project_dir}"
do "choropleth8.do"
display "Hello world!"
*****END RUN THE VARIOUS DO FILES*****
end