-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path00_data_import_nca.do
80 lines (55 loc) · 1.78 KB
/
00_data_import_nca.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
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PURPOSE: WC - NCA Lashio Project
AUTHOR: Nicholus
CREATED: 02 Dec 2019
MODIFIED:
THINGS TO DO:
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
** IMPORT DATASET **
import excel using "$raw/NCA_LAISHIO_WC_FINAL_2019_12_11_08_57_30_839866-group-name-removed.xls", describe
// sheet("data") cellrange(A7:EI103)firstrow case(lower) allstring clear
local n_sheets `r(N_worksheet)'
forvalues j = 1/`n_sheets' {
local sheet_`j' `r(worksheet_`j')'
}
forvalues i = 1/`n_sheets' {
local range_`i' `r(range_`i')'
}
forvalues j = 1/`n_sheets' {
import excel using "$raw/NCA_LAISHIO_WC_FINAL_2019_12_11_08_57_30_839866-group-name-removed.xls", ///
sheet("`sheet_`j''") ///
firstrow case(lower) ///
cellrange(`range_`j'') ///
allstring clear
if `j' <= 2 {
count if !mi(_index)
di "`sheet_`j'' : `r(N)'"
save "$dta/`sheet_`j''.dta", replace
}
else if "`sheet_`j''" == "consent_child_vc_rep" {
keep if !mi(child_ill)
count if !mi(child_ill)
di "`sheet_`j'' : `r(N)'"
save "$dta/`sheet_`j''.dta", replace
}
else if "`sheet_`j''" == "consent_grp_q2_5_to_q2_7" {
keep if !mi(child_bf)
count if !mi(child_bf)
di "`sheet_`j'' : `r(N)'"
save "$dta/`sheet_`j''.dta", replace
}
else if "`sheet_`j''" == "consent_ancpast_rep" {
keep if !mi(ancpast_adopt)
count if !mi(ancpast_adopt)
di "`sheet_`j'' : `r(N)'"
save "$dta/`sheet_`j''.dta", replace
}
else if "`sheet_`j''" == "consent_childanthro_rep" {
keep if !mi(cal_anthro)
count if !mi(cal_anthro)
di "`sheet_`j'' : `r(N)'"
save "$dta/`sheet_`j''.dta", replace
}
}
clear