-
Notifications
You must be signed in to change notification settings - Fork 0
/
projectdo.do
91 lines (67 loc) · 2.54 KB
/
projectdo.do
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
* Project: WB COVID
* Created on: July 2020
* Created by: jdm
* Stata v.16.1
* does
* establishes an identical workspace between users
* sets globals that define absolute paths
* serves as the starting point to find any do-file, dataset or output
* loads any user written packages needed for analysis
* assumes
* access to all data and code
* **********************************************************************
* 0 - setup
* **********************************************************************
* set $pack to 0 to skip package installation
global pack 0
* Specify Stata version in use
global stataVersion 16.1 // set Stata version
version $stataVersion
* **********************************************************************
* 0 (a) - Create user specific paths
* **********************************************************************
* Define root folder globals
if `"`c(username)'"' == "USERNAME" {
global code "C:/Users/USERNAME/git/evolving_impacts_covid_africa"
global data "C:/Users/USERNAME/evolving_impacts/data"
global output "C:/Users/USERNAME/evolving_impacts/output"
global ans "$data/analysis"
}
* **********************************************************************
* 0 (b) - Check if any required packages are installed:
* **********************************************************************
* install packages if global is set to 1
if $pack == 1 {
* for packages/commands, make a local containing any required packages
loc userpack "catplot grc1leg2 palettes"
* install packages that are on ssc
foreach package in `userpack' {
capture : which `package', all
if (_rc) {
capture window stopbox rusure "You are missing some packages." "Do you want to install `package'?"
if _rc == 0 {
capture ssc install `package', replace
if (_rc) {
window stopbox rusure `"This package is not on SSC. Do you want to proceed without it?"'
}
}
else {
exit 199
}
}
}
* update all ado files
ado update, update
* set graph and Stata preferences
set scheme plotplain, perm
set more off
}
* **********************************************************************
* 1 - run household data cleaning .do file
* **********************************************************************
do "$code/analysis/pnl_cleaning.do"
* **********************************************************************
* 2 - run analysis .do file
* **********************************************************************
do "$code/analysis/evolving_impact.do"
/* END */