-
Notifications
You must be signed in to change notification settings - Fork 2
/
projectdo.do
159 lines (130 loc) · 5.18 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
* Project: WB Weather
* Created on: May 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
* runs all do-files needed for data work. ([!] Eventually)
* loads any user written packages needed for analysis
* assumes
* access to all data and code
* TO DO:
* add all do-files
* add info on grc1leg2.ado
* **********************************************************************
* 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/weather_project"
global data "C:/Users/jdmichler/OneDrive - University of Arizona/weather_project"
}
if `"`c(username)'"' == "aljosephson" {
global code "C:/Users/aljosephson/git/weather_project"
global data "G:/My Drive/weather_project"
}
if `"`c(username)'"' == "themacfreezie" {
global code "C:/Users/themacfreezie/git/weather_project"
global data "G:/My Drive/weather_project"
}
if `"`c(username)'"' == "emilk" {
global code "C:/Users/emilk/git/weather_project"
global data "G:/My Drive/weather_project"
}
* **********************************************************************
* 0 (b) - Check if any required packages are installed:
* **********************************************************************
* install packages if global is set to 1
if $pack == 1 {
* temporarily set delimiter to ; so can break the line
#delimit ;
* for packages/commands, make a local containing any required packages
loc userpack "blindschemes mdesc estout distinct winsor2" ;
#delimit cr
* 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/)
* install -customsave package
net install StataConfig, ///
from(https://raw.githubusercontent.com/etjernst/Materials/master/stata/) replace
* install -weather- package
net install WeatherConfig, ///
from(https://jdavidm.github.io/) replace
* update all ado files
ado update, update
* set graph and Stata preferences
set scheme plotplain, perm
set more off
}
* **********************************************************************
* 1 - run weather data cleaning .do file
* **********************************************************************
/*
do "$code/ethiopia/weather_code/eth_ess_masterdo.do"
do "$code/malawi/weather_code/mwi_ihs_masterdo.do"
do "$code/niger/weather_code/ngr_ecvma_masterdo.do"
do "$code/nigeria/weather_code/nga_ghs_masterdo.do"
do "$code/tanzania/weather_code/tza_nps_masterdo.do"
do "$code/uganda/weather_code/uga_unps_masterdo.do"
*/
* **********************************************************************
* 2 - run household data cleaning .do files and merge with weather data
* **********************************************************************
/*
do "$code/ethiopia/household_code/eth_hh_masterdo.do"
do "$code/malawi/household_code/mwi_hh_masterdo.do"
do "$code/niger/household_code/ngr_hh_masterdo.do"
do "$code/nigeria/household_code/nga_hh_masterdo.do"
do "$code/tanzania/household_code/tza_hh_masterdo.do"
do "$code/uganda/household_code/uga_hh_masterdo.do"
*/
* **********************************************************************
* 3 - build cross-country household panel data set
* **********************************************************************
/*
do "$code/analysis/reg_code/panel_build.do"
*/
* **********************************************************************
* 4 - run regression .do files
* **********************************************************************
/*
do "$code/analysis/reg_code/regressions.do"
do "$code/analysis/reg_code/regressions-linear-combo.do"
do "$code/analysis/reg_code/regressions-multi-combo.do"
*/
* **********************************************************************
* 5 - run analysis .do files
* **********************************************************************
/*
do "$code/analysis/viz_code/sum_table.do"
do "$code/analysis/viz_code/sum_vis.do"
do "$code/analysis/viz_code/r2_vis.do"
do "$code/analysis/viz_code/pval_vis.do"
do "$code/analysis/viz_code/coeff_vis.do"
do "$code/analysis/viz_code/coeff_lc_vis.do"
do "$code/analysis/viz_code/coeff_mc_vis.do"