Skip to content

Commit d2a874e

Browse files
committed
upload SBP CRF 93 syntax
1 parent fdf9993 commit d2a874e

2 files changed

Lines changed: 67 additions & 313 deletions

File tree

Lines changed: 19 additions & 150 deletions
Original file line numberDiff line numberDiff line change
@@ -1,158 +1,27 @@
11
* Encoding: UTF-8.
22

3-
*can only download repeat csv data as zip file from moda with group names - will update this code to remove group names
4-
*rename to remove group names - because of the variable length SPSS changes name slightly
3+
*this syntax is based on SPSS download version from MoDA
54

6-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWStapCer = PWMDDWStapCer).
7-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWStapRoo = PWMDDWStapRoo).
8-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPulse = PWMDDWPulse).
9-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWNuts = PWMDDWNuts).
10-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWMilk = PWMDDWMilk).
11-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWDairy = PWMDDWDairy).
12-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrMeatO = PWMDDWPrMeatO).
13-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrMeatF = PWMDDWPrMeatF).
14-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrMeatPro = PWMDDWPrMeatPro).
15-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrMeatWhite = PWMDDWPrMeatWhite).
16-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrFish = PWMDDWPrFish).
17-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWPrEgg = PWMDDWPrEgg).
18-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWVegGre = PWMDDWVegGre).
19-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWVegOrg = PWMDDWVegOrg).
20-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFruitOrg = PWMDDWFruitOrg).
21-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWVegOth = PWMDDWVegOth).
22-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFruitOth = PWMDDWFruitOth).
23-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWSnf = PWMDDWSnf).
24-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodoil = PWMDDWFortFoodoil).
25-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodwflour = PWMDDWFortFoodwflour).
26-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodmflour = PWMDDWFortFoodmflour).
27-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodrice = PWMDDWFortFoodrice).
28-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFooddrink = PWMDDWFortFooddrink).
29-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodother_A = PWMDDWFortFoodother).
30-
RENAME VARIABLES (Nutrition_moduleMDD_W_submoduleRepeatMDDWPWMDDWFortFoodother = PWMDDWFortFoodother_oth).
5+
* Filter dataset for children registered to attend school.
6+
SELECT IF (PChildRegisterSchool = 1).
317

32-
Variable labels PWMDDWStapCer "Foods made from grains".
33-
Variable labels PWMDDWStapRoo "White roots and tubers or plantains".
34-
Variable labels PWMDDWPulse "Pulses (beans, peas and lentils)".
35-
Variable labels PWMDDWNuts "Nuts and seeds".
36-
Variable labels PWMDDWMilk "Milk".
37-
Variable labels PWMDDWDairy "Milk products".
38-
Variable labels PWMDDWPrMeatO "Organ meats".
39-
Variable labels PWMDDWPrMeatF "Red flesh meat from mammals".
40-
Variable labels PWMDDWPrMeatPro "Processed meat".
41-
Variable labels PWMDDWPrMeatWhite "Poultry and other white meats".
42-
Variable labels PWMDDWPrFish "Fish and Seafood".
43-
Variable labels PWMDDWPrEgg "Eggs from poultry or any other bird".
44-
Variable labels PWMDDWVegGre "Dark green leafy vegetable".
45-
Variable labels PWMDDWVegOrg "Vitamin A-rich vegetables, roots and tubers".
46-
Variable labels PWMDDWFruitOrg "Vitamin A-rich fruits".
47-
Variable labels PWMDDWVegOth "Other vegetables".
48-
Variable labels PWMDDWFruitOth "Other fruits".
49-
Variable labels PWMDDWSnf "Specialized Nutritious Foods (SNF) for women".
50-
Variable labels PWMDDWFortFoodoil "Fortified oil".
51-
Variable labels PWMDDWFortFoodwflour "Fortified wheat flour".
52-
Variable labels PWMDDWFortFoodmflour "Fortified maize flour".
53-
Variable labels PWMDDWFortFoodrice "Fortified Rice".
54-
Variable labels PWMDDWFortFooddrink "Fortified drink".
55-
Variable labels PWMDDWFortFoodother "Other:".
56-
Variable labels PWMDDWFortFoodother_oth "Other: please specify: ____________".
8+
* Compute a variable for absence due to ill health as a binary indicator.
9+
COMPUTE AbsentDueToIllHealth = (PChildDayAbsSchoolWhy.1 = 1).
5710

58-
Value labels PWMDDWStapCer,PWMDDWStapRoo,PWMDDWPulse,PWMDDWNuts,PWMDDWMilk,PWMDDWDairy,PWMDDWPrMeatO,PWMDDWPrMeatF,PWMDDWPrMeatPro,PWMDDWPrMeatWhite,PWMDDWPrFish,
59-
PWMDDWPrEgg,PWMDDWVegGre,PWMDDWVegOrg,PWMDDWFruitOrg,PWMDDWVegOth,PWMDDWFruitOth,PWMDDWSnf,PWMDDWFortFoodoil,PWMDDWFortFoodwflour,PWMDDWFortFoodmflour,PWMDDWFortFoodrice,PWMDDWFortFooddrink,PWMDDWFortFoodother 1 'Yes' 0 'No '.
11+
* Aggregate data to calculate total registered and total absent due to ill health.
12+
DATASET DECLARE AggregatedData.
13+
AGGREGATE OUTFILE='AggregatedData'
14+
/BREAK=
15+
/TotalRegistered = N
16+
/TotalAbsentDueToIllHealth = SUM(AbsentDueToIllHealth).
6017

61-
*Calculate 2 MDDW indicators based on https://docs.wfp.org/api/documents/WFP-0000140197/download/ pg.8
62-
*Standard MDDW Indicator for population based surveys - counts SNF in home group (refer to https://docs.wfp.org/api/documents/WFP-0000139484/download/ for "home group")
63-
*WFP Modified MDDW WFP programme monitoring - counts SNF in "Meat, poultry and fish" Category
64-
65-
*Standard MDDW method - in this example SNF home group will be grains
66-
*in this example all - PWMDDWFortFoodwflour,PWMDDWFortFoodmflour,PWMDDWFortFoodrice,PWMDDWFortFooddrink will also count in grains
67-
*classifying PWMDDWFortFoodother_oth will likely involve classifying line by line
68-
69-
Compute MDDW_Staples = 0.
70-
if (PWMDDWStapCer) = 1 | (PWMDDWStapRoo) = 1 | (PWMDDWSnf = 1) | (PWMDDWFortFoodwflour = 1) | (PWMDDWFortFoodmflour = 1) | (PWMDDWFortFoodrice = 1) | (PWMDDWFortFooddrink = 1) MDDW_Staples= 1.
71-
compute MDDW_Pulses = 0.
72-
if (PWMDDWPulse = 1) MDDW_Pulses = 1.
73-
Compute MDDW_NutsSeeds = 0.
74-
if (PWMDDWNuts = 1) MDDW_NutsSeeds = 1.
75-
Compute MDDW_Dairy = 0.
76-
if (PWMDDWDairy = 1) | (PWMDDWMilk = 1) MDDW_Dairy = 1.
77-
Compute MDDW_MeatFish = 0.
78-
if (PWMDDWPrMeatO = 1) | (PWMDDWPrMeatF = 1) | (PWMDDWPrMeatPro = 1) | (PWMDDWPrMeatWhite = 1) | (PWMDDWPrFish = 1) MDDW_MeatFish = 1.
79-
Compute MDDW_Eggs = 0.
80-
if (PWMDDWPrEgg = 1) MDDW_Eggs = 1.
81-
Compute MDDW_LeafGreenVeg = 0.
82-
if (PWMDDWVegGre = 1) MDDW_LeafGreenVeg = 1..
83-
Compute MDDW_VitA = 0.
84-
if (PWMDDWVegOrg = 1) | (PWMDDWFruitOrg = 1) MDDW_VitA = 1.
85-
Compute MDDW_OtherVeg = 0.
86-
if (PWMDDWVegOth = 1) MDDW_OtherVeg = 1.
87-
Compute MDDW_OtherFruits = 0.
88-
if (PWMDDWFruitOth = 1) MDDW_OtherFruits = 1.
89-
90-
91-
*WFP MDDW method for program monitoring - SNF will count in the meats group
92-
*in this example all - PWMDDWFortFoodwflour,PWMDDWFortFoodmflour,PWMDDWFortFoodrice,PWMDDWFortFooddrink will also count in grains
93-
*classifying PWMDDWFortFoodother_oth will likely involve classifying line by line
94-
95-
compute MDDW_Staples_wfp = 0.
96-
if (PWMDDWStapCer) = 1 | (PWMDDWStapRoo) = 1 | (PWMDDWFortFoodwflour = 1) | (PWMDDWFortFoodmflour = 1) | (PWMDDWFortFoodrice = 1) | (PWMDDWFortFooddrink = 1) MDDW_Staples_wfp = 1.
97-
Compute MDDW_Pulses_wfp = 0.
98-
if (PWMDDWPulse = 1) MDDW_Pulses_wfp = 1.
99-
Compute MDDW_NutsSeeds_wfp = 0.
100-
if (PWMDDWNuts = 1) MDDW_NutsSeeds_wfp = 1.
101-
Compute MDDW_Dairy_wfp = 0.
102-
if (PWMDDWDairy = 1) | (PWMDDWMilk = 1) MDDW_Dairy_wfp = 1.
103-
Compute MDDW_MeatFish_wfp = 0.
104-
if (PWMDDWPrMeatO = 1) | (PWMDDWPrMeatF = 1) | (PWMDDWPrMeatPro = 1) | (PWMDDWPrMeatWhite = 1) | (PWMDDWPrFish = 1) | (PWMDDWSnf = 1) MDDW_MeatFish_wfp = 1.
105-
Compute MDDW_Eggs_wfp = 0.
106-
if (PWMDDWPrEgg = 1) MDDW_Eggs_wfp = 1.
107-
compute MDDW_LeafGreenVeg_wfp = 0.
108-
if (PWMDDWVegGre = 1) MDDW_LeafGreenVeg_wfp = 1 .
109-
Compute MDDW_VitA_wfp = 0.
110-
if (PWMDDWVegOrg = 1) | (PWMDDWFruitOrg = 1) MDDW_VitA_wfp= 1.
111-
Compute MDDW_OtherVeg_wfp = 0.
112-
if (PWMDDWVegOth = 1) MDDW_OtherVeg_wfp = 1.
113-
Compute MDDW_OtherFruits_wfp = 0.
114-
if (PWMDDWFruitOth = 1) MDDW_OtherFruits_wfp = 1.
115-
116-
117-
118-
119-
*calculate MDDW variable for both methods by adding together food groups and classifying whether the woman consumed 5 or more food groups
120-
121-
*Standard MDDW method where SNF is counted in grains
122-
123-
compute MDDW = sum(MDDW_Staples ,MDDW_Pulses ,MDDW_NutsSeeds ,MDDW_Dairy ,MDDW_MeatFish ,MDDW_Eggs ,MDDW_LeafGreenVeg ,MDDW_VitA ,MDDW_OtherVeg ,MDDW_OtherFruits).
124-
125-
*count how many women consumed 5 or more groups
126-
127-
Compute MDDW_5 = 0.
128-
if (MDDW >= 5) MDDW_5 = 1.
129-
Value labels MDDW_5 1 '>=5' 0 '<5 '.
130-
131-
Value labels MDDW_5 1 '>=5' 0 '<5 '.
132-
133-
134-
135-
*WFP MDDW method for program monitoring - SNF will count in the meats group
136-
137-
compute MDDW_wfp = sum(MDDW_Staples_wfp,MDDW_Pulses_wfp ,MDDW_NutsSeeds_wfp ,MDDW_Dairy_wfp ,MDDW_MeatFish_wfp ,MDDW_Eggs_wfp ,MDDW_LeafGreenVeg_wfp ,MDDW_VitA_wfp ,MDDW_OtherVeg_wfp ,MDDW_OtherFruits_wfp).
138-
139-
*count how many women consumed 5 or more groups
140-
141-
142-
Compute MDDW_5_wfp = 0.
143-
if (MDDW_wfp >= 5) MDDW_5_wfp = 1.
144-
Value labels MDDW_5_wfp 1 '>=5' 0 '<5 '.
145-
146-
Value labels MDDW_5_wfp 1 '>=5' 0 '<5 '.
147-
148-
149-
*Frequency of Standard MDDW Method - MDDW_5
150-
151-
freq MDDW_5.
152-
153-
154-
*Frequency of WFP MDDW method for program monitoring - MDDW_5_wfp
155-
156-
freq MDDW_5_wfp.
18+
* Compute the percentage of absences due to ill health.
19+
DATASET ACTIVATE AggregatedData.
20+
COMPUTE PercentAbsentDueToIllHealth = (TotalAbsentDueToIllHealth / TotalRegistered) * 100.
15721

22+
* Assign a label to the new percentage variable.
23+
VARIABLE LABELS PercentAbsentDueToIllHealth '% Children Missing School Due to Ill Health'.
15824

25+
* Display the result.
26+
FORMATS PercentAbsentDueToIllHealth (F2.2).
27+
LIST.

0 commit comments

Comments
 (0)