-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathprojectdo.do
108 lines (79 loc) · 3.01 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
* 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
* TO DO:
* add all do-files
* **********************************************************************
* 0 - setup
* **********************************************************************
* set $pack to 0 to skip package installation
global pack 1
* 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)'"' == "jdmichler" {
global code "C:/Users/jdmichler/git/wb_covid"
global data "G:/My Drive/wb_covid/data"
global output_f "G:/My Drive/wb_covid/output"
}
if `"`c(username)'"' == "aljosephson" {
global code "C:/Users/aljosephson/git/wb_covid"
global data "G:/My Drive/wb_covid/data"
global output_f "G:/My Drive/wb_covid/output"
}
if `"`c(username)'"' == "annfu" {
global code "C:/Users/annfu/git/wb_covid"
global data "G:/My Drive/wb_covid/data"
global output_f "G:/My Drive/wb_covid/output"
}
* **********************************************************************
* 0 (b) - Check if any required packages are installed:
* **********************************************************************
* install packages if global is set to 1
if $pack == 0 {
* for packages/commands, make a local containing any required packages
loc userpack "blindschemes mdesc estout distinct winsor2 palettes catplot grc1leg2 colrspace"
* 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
}
}
}
* install -xfill- package
net install xfill, replace from(https://www.sealedenvelope.com/)
* 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" //runs all cleaning files
* **********************************************************************
* 2 - run analysis .do files
* **********************************************************************
/* END */