Repository navigation
Expand file tree
/
Copy pathsurvey_restricted.do
More file actions
75 lines (48 loc) · 1.73 KB
/
Copy pathsurvey_restricted.do
File metadata and controls
75 lines (48 loc) · 1.73 KB
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
/* Example: survey_restricted.do using survey.dta */
clear
set more 1
/* Higher memory might be necessary for larger datasets */
set memory 20m
set maxvar 10000
/* Indicate to the Stata compiler where the igrowup_restricted.ado file is stored*/
adopath + "D:\WHO igrowup STATA/"
/* Load the data file */
use "D:\WHO igrowup workdata\survey.dta", clear
/* generate the first three parameters reflib, datalib & datalab */
gen reflib="D:\WHO igrowup STATA"
lab var reflib "Directory of reference tables"
gen datalib="D:\WHO igrowup workdata"
lab var datalib "Directory for datafiles"
gen datalab="mysurvey"
lab var datalab "Working file"
/* check the variable for "sex" 1 = male, 2=female */
desc gender
tab gender
/* check the variable for "age" */
desc agemons
summ agemons
/* define your ageunit */
gen str6 ageunit="months" /* or gen ageunit="days" */
lab var ageunit "=days or =months"
/* check the variable for body "weight" which must be in kilograms*/
/* NOTE: if not available, please create as [gen weight=.]*/
desc weight
summ weight
/* check the variable for "height" which must be in centimeters */
/* NOTE: if not available, please create as [gen height=.]*/
desc height
summ height
/* check the variable for "measure"*/
/* NOTE: if not available, please create as [gen str1 measure=" "]*/
desc measure
tab measure
/* check the variable for "oedema"*/
/* NOTE: if not available, please create as [gen str1 oedema="n"]*/
desc oedema
tab oedema
/* check the variable for "sw" for the sampling weight*/
/* NOTE: if not available, please create as [gen sw=1]*/
desc sw
summ sw
/* Fill in the macro parameters to run the command */
igrowup_restricted reflib datalib datalab gender agemons ageunit weight height measure oedema sw