-
Notifications
You must be signed in to change notification settings - Fork 0
/
projectdo.do
117 lines (88 loc) · 3.49 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
109
110
111
112
113
114
115
116
117
* Project: COVID Food Security
* Created on: July 2020
* Created by: jdm
* Stata v.17.0
* 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
* access to cleaned data produced by https://github.com/AIDELabAZ/wb_covid
* TO DO:
* check packages used
************************************************************************
**# 0 - setup
************************************************************************
* set $pack to 0 to skip package installation
global pack 0
* Specify Stata version in use
global stataVersion 17.0 // 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/AIDELabAZ/covid_food_security"
global data "G:/My Drive/wb_covid/data"
global output "G:/My Drive/wb_covid/output/food_security/paper"
}
if `"`c(username)'"' == "aljosephson" {
global code "C:/Users/aljosephson/git/wb_covid"
global data "G:/My Drive/wb_covid/data"
global output "G:/My Drive/wb_covid/output/food_security/paper"
}
if `"`c(username)'"' == "lirro" {
global code "C:/Users/lirro/Documents/GitHub/covid_food_security"
global data "G:/My Drive/wb_covid/data"
global output "G:/My Drive/wb_covid/output/food_security/paper"
}
************************************************************************
**# 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 "blindschemes estout palettes colrspace carryforward"
* 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
************************************************************************
* run do files for each country (takes a little while to run)
run "$code/ethiopia/eth_fies_0"
run "$code/malawi/mwi_fies_0"
run "$code/nigeria/nga_fies_pp0"
run "$code/nigeria/nga_fies_ph0"
run "$code/burkina_faso/bf_fies_0"
************************************************************************
**# 2 - run final cleaning and analysis .do files
************************************************************************
run "$code/analysis/pnl_cleaning_fies.do"
run "$code/analysis/figures/desc_figs.do"
run "$code/analysis/fies_regs"
/* END */