Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 109 additions & 32 deletions Indicators/Food-consumption-score/FCS-indicator-calculation.sps
Original file line number Diff line number Diff line change
@@ -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.
Comment on lines +35 to 40
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These rows refer to a logical data cleaning of the dataset.
Suggest to move to dedicated cleaning process.


*** 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.
Comment on lines +49 to +80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outlier detection step, this should be done in the statistical cleaning process.


*** 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
*** 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.

*** ----------------------------------------------------------------------------------------------------
Comment on lines +101 to +122
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a second copy of the indicator with reversed classes?
I find this confusing.

*** END OF SCRIPT
*** ----------------------------------------------------------------------------------------------------