From 992354cdabfeb0d6c78d9867109633a804e93c02 Mon Sep 17 00:00:00 2001 From: odai-saleh Date: Sat, 11 Oct 2025 00:52:02 +0200 Subject: [PATCH] Update FCS-indicator-calculation.sps --- .../FCS-indicator-calculation.sps | 141 ++++++++++++++---- 1 file changed, 109 insertions(+), 32 deletions(-) diff --git a/Indicators/Food-consumption-score/FCS-indicator-calculation.sps b/Indicators/Food-consumption-score/FCS-indicator-calculation.sps index 17ce50a..ec33bea 100644 --- a/Indicators/Food-consumption-score/FCS-indicator-calculation.sps +++ b/Indicators/Food-consumption-score/FCS-indicator-calculation.sps @@ -1,51 +1,128 @@ -*** -------------------------------------------------------------------------- +* Encoding: UTF-8. -*** WFP RAM Standardized Scripts -*** Calculating Food Consumption Score (FCS) +*** -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -*** -------------------------------------------------------------------------- +*** WFP Standardized Scripts +*** Food Consumption Score (FCS), 28-42 thresholds -* Encoding: UTF-8. -*** Define labels - -Variable labels -FCSStap 'Consumption over the past 7 days: cereals, grains and tubers' -FCSPulse 'Consumption over the past 7 days: pulses' -FCSDairy 'Consumption over the past 7 days: dairy products' -FCSPr 'Consumption over the past 7 days: meat, fish and eggs' -FCSVeg 'Consumption over the past 7 days: vegetables and leaves' -FCSFruit 'Consumption over the past 7 days: fruit' -FCSFat 'Consumption over the past 7 days: fat and oil' -FCSSugar 'Consumption over the past 7 days: sugar or sweets' -FCSCond 'Consumption over the past 7 days: condiments or spices'. - -*** Calculate FCS -Compute FCS = sum(FCSStap*2, FCSPulse*3, FCSDairy*4, FCSPr*4, FCSVeg*1, FCSFruit*1, FCSFat*0.5, FCSSugar*0.5). -Variable labels FCS "Food Consumption Score". +*** Last Update: Oct 2025 +*** Purpose: This script calculates the Food Consumption Score (FCS) using standard methodology with HIGH thresholds (28-42) for sugar/oil consuming populations. +*** For setting the right threshold, please refer to the FCS technical guidance on the VAM Resource Centre: https://resource-centre.document360.io/docs/food-consumption-score + +*** WFP Data Quality Guidance References: +*** - Recommended high frequency checks: Page 30 +*** - Recommended cleaning steps: Page 36-37 + +*** Find the WFP Data Quality Guidance here: https://resource-centre.document360.io/docs/data-quality + +*** -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + + +*** Define group labels- these should match Survey Designer naming conventions + +VARIABLE LABELS +FCSStap "Consumption over the past 7 days: Cereals, grains and tubers" +FCSPulse "Consumption over the past 7 days: Pulses" +FCSDairy "Consumption over the past 7 days: Dairy" +FCSPr "Consumption over the past 7 days: Meat, fish and eggs" +FCSVeg "Consumption over the past 7 days: Vegetables and leaves" +FCSFruit "Consumption over the past 7 days: Fruit" +FCSFat "Consumption over the past 7 days: Fat and oil" +FCSSugar "Consumption over the past 7 days: Sugar or sweets" +FCSCond "Consumption over the past 7 days: Condiments or spices". + +*** Harmonize Data Quality Guidance measures +*** Clean impossible values + +RECODE FCSStap FCSPulse FCSDairy FCSPr FCSVeg FCSFruit FCSFat FCSSugar (LOWEST THRU -1 = SYSMIS). +RECODE FCSStap FCSPulse FCSDairy FCSPr FCSVeg FCSFruit FCSFat FCSSugar (8 THRU HIGHEST = SYSMIS). EXECUTE. -*** Use this when analyzing a country with low consumption of sugar and oil - thresholds 21-35 +*** Calculate FCS (use + instead of SUM to automatically drop missing values from the final FCS) + *** Note: Condiments (FCSCond) are not included in standard FCS calculation -Recode FCS (lowest thru 21 = 1) (21.5 thru 35 = 2) (35.5 thru highest = 3) into FCSCat21. -Variable labels FCSCat21 "FCS Categories: 21/35 thresholds". +COMPUTE FCS = FCSStap*2 + FCSPulse*3 + FCSDairy*4 + FCSPr*4 + FCSVeg*1 + FCSFruit*1 + FCSFat*0.5 + FCSSugar*0.5. +VARIABLE LABELS FCS "Food Consumption Score". EXECUTE. -*** Define value labels and properties for "FCS Categories". +*** Harmonize Data Quality Guidance measures +*** Check that FCS is between 0-112 + +DESCRIPTIVES VARIABLES=FCS + /STATISTICS=MEAN STDDEV MIN MAX. + +*** Clean any impossible FCS values -Value labels FCSCat21 1.00 "Poor" 2.00 "Borderline" 3.00 "Acceptable". +RECODE FCS (LOWEST THRU -1 = SYSMIS). +RECODE FCS (113 THRU HIGHEST = SYSMIS). EXECUTE. -*** Important note: pay attention to the threshold used by your CO when selecting the syntax (21 cat. vs 28 cat.) -*** Use this when analyzing a country with high consumption of sugar and oil – thresholds 28-42 +*** Flagging potential Data Quality issues. If any cases reflected here, refer to the Data Quality Guidance note pages 36-37. This can be found on the VAM Ressource Centre + +COMPUTE FCS_flag_low = 0. +IF (FCS LT 14) FCS_flag_low = 1. +VARIABLE LABELS FCS_flag_low "FCS has low values that could be a Data Quality issue. Refer to the Data Quality guidance for recommended actions". +VALUE LABELS FCS_flag_low + 0 "No" + 1 "Yes". + +COMPUTE FCS_flag_high = 0. +IF (FCS GT 100) FCS_flag_high = 1. +VARIABLE LABELS FCS_flag_high "FCS has high values that could be a Data Quality issue. Refer to the Data Quality guidance for recommended actions". +VALUE LABELS FCS_flag_high + 0 "No" + 1 "Yes". + +* Check flagged cases -Recode FCS (lowest thru 28 = 1) (28.5 thru 42 = 2) (42.5 thru highest = 3) into FCSCat28. -Variable labels FCSCat28 "FCS Categories: 28/42 thresholds". +FREQUENCIES VARIABLES=FCS_flag_low FCS_flag_high + /ORDER=ANALYSIS. + +*** Use this when analyzing a country with HIGH consumption of sugar and oil – thresholds 28-42 + +RECODE FCS (LOWEST THRU 28 = 3) (28.5 THRU 42 = 2) (42.5 THRU HIGHEST = 1) INTO FCSCat28. +VARIABLE LABELS FCSCat28 "FCS Categories: High thresholds - for IPC". EXECUTE. *** Define value labels and properties for "FCS Categories" -Value labels FCSCat28 1.00 "Poor" 2.00 "Borderline" 3.00 "Acceptable". +VALUE LABELS FCSCat28 + 1 "Poor" + 2 "Borderline" + 3 "Acceptable". EXECUTE. -*** End of scripts \ No newline at end of file +*** Check distribution of final categories + +FREQUENCIES VARIABLES=FCSCat28 + /ORDER=ANALYSIS. + +*** Sample check of food group distributions (recommended for data quality review) + +FREQUENCIES VARIABLES=FCSStap FCSPulse FCSDairy FCSPr FCSVeg FCSFruit FCSFat FCSSugar + /FORMAT=NOTABLE + /STATISTICS=MINIMUM MAXIMUM MEAN. + +*** Optional: Compute the same variable to be used directly for IPC analysis (referring to IPC phases) + +RECODE FCS (LOWEST THRU 28 = 1) (28.5 THRU 42 = 2) (42.5 THRU HIGHEST = 3) INTO FCSCat28IPC. +VARIABLE LABELS FCSCat28IPC "Official IPC Classification for FCS - high thresholds". +VALUE LABELS FCSCat28IPC + 1 "Acceptable - IPC Phase 1-2" + 2 "Borderline - IPC Phase 3" + 3 "Poor - IPC Phase 4-5". +EXECUTE. + +*** Check distribution of final categories + +FREQUENCIES VARIABLES=FCSCat28IPC + /ORDER=ANALYSIS. + +*** ---------------------------------------------------------------------------------------------------- +*** END OF SCRIPT +*** ---------------------------------------------------------------------------------------------------- + + + +