-
Notifications
You must be signed in to change notification settings - Fork 28
Update FCSN-indicator-calculation.sps #199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,66 +1,115 @@ | ||
| *** -------------------------------------------------------------------------- | ||
| * Encoding: UTF-8. | ||
| *** ---------------------------------------------------------------------------------------------------- | ||
|
|
||
| *** WFP RAM Standardized Scripts | ||
| *** Calculating Food Consumption Score Nutrition (FCSN) | ||
| *** WFP Standardized Scripts | ||
| *** Food Consumption Score - Nutrition (FCS-N) | ||
|
|
||
| *** -------------------------------------------------------------------------- | ||
|
|
||
| * Encoding: UTF-8. | ||
| *** Last Update: Oct 2025 | ||
| *** Purpose: This script calculates the Food Consumption Score - Nutrition (FCS-N) | ||
|
|
||
| *** Data Quality Guidance References: | ||
| *** - Recommended high frequency checks: Page 30 | ||
| *** - Recommended cleaning steps: Page 37 | ||
|
|
||
| *** ---------------------------------------------------------------------------------------------------- | ||
|
|
||
| *** Define group labels- these should match Survey Designer naming conventions | ||
|
|
||
| VARIABLE LABELS | ||
| FCSNPrMeatF "Consumption in past 7 days: Flesh meat" | ||
| FCSNPrMeatO "Consumption in past 7 days: Organ meat" | ||
| FCSNPrFish "Consumption in past 7 days: Fish/shellfish" | ||
| FCSNPrEggs "Consumption in past 7 days: Eggs" | ||
| FCSNVegOrg "Consumption in past 7 days: Orange vegetables (vegetables rich in Vitamin A)" | ||
| FCSNVegGre "Consumption in past 7 days: Green leafy vegetables" | ||
| FCSNFruiOrg "Consumption in past 7 days: Orange fruits (fruits rich in Vitamin A)". | ||
|
|
||
| *** Check individual food groups | ||
|
|
||
| FREQUENCIES VARIABLES = FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg | ||
| /STATISTICS = MINIMUM MAXIMUM MEAN | ||
| /ORDER = ANALYSIS. | ||
|
|
||
| *** In cases where 0 consumption of main group automatically codes subgroup values as missing, recoding to 0 consumption | ||
|
|
||
| RECODE FCSNPrMeatO FCSNPrMeatF FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (SYSMIS = 0). | ||
| EXECUTE. | ||
|
|
||
| *** Harmonize Data Quality Guidance measures | ||
| *** Clean impossible values | ||
|
|
||
| *** Define labels | ||
|
|
||
| Variable labels | ||
| FCSNPrMeatF "Consumption in past 7 days: Flesh meat" | ||
| FCSNPrMeatO "Consumption in past 7 days: Organ meat" | ||
| FCSNPrFish "Consumption in past 7 days: Fish/shellfish" | ||
| FCSNPrEggs "Consumption in past 7 days: Eggs" | ||
| FCSNVegOrg "Consumption in past 7 days: Orange vegetables (vegetables rich in Vitamin A)" | ||
| FCSNVegGre "Consumption in past 7 days: Green leafy vegetables" | ||
| FCSNFruiOrg "Consumption in past 7 days: Orange fruits (Fruits rich in Vitamin A)". | ||
|
|
||
| *** Recode "n/a" values to 0 and change variable type to numeric | ||
|
|
||
| ALTER TYPE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (a5). | ||
|
|
||
| RECODE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg | ||
| ('n/a'='0'). | ||
| RECODE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (LOWEST THRU -1 = SYSMIS). | ||
| RECODE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (8 THRU HIGHEST = SYSMIS). | ||
|
Comment on lines
+39
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of the logical data cleaning step |
||
| EXECUTE. | ||
|
|
||
| ALTER TYPE FCSNPrMeatF FCSNPrMeatO FCSNPrFish FCSNPrEggs FCSNVegOrg FCSNVegGre FCSNFruiOrg (F1). | ||
| *** Flagging potential Data Quality issues. If any cases reflected here, refer to the Data Quality Guidance note page 37. This can be found on the VAM Ressource Centre | ||
|
|
||
| COMPUTE FCSN_flag_protein = 0. | ||
| IF (FCSNPrMeatF > FCSPr OR FCSNPrMeatO > FCSPr OR FCSNPrFish > FCSPr OR FCSNPrEggs > FCSPr) FCSN_flag_protein = 1. | ||
| VARIABLE LABELS FCSN_flag_protein "Subgroup exceeds main group. Flag issue to team leader during high frequency check. During cleaning, recode value to be capped at value for main group". | ||
| VALUE LABELS FCSN_flag_protein | ||
| 0 "No" | ||
| 1 "Yes". | ||
|
|
||
| COMPUTE FCSN_flag_veg = 0. | ||
| IF (FCSNVegOrg > FCSVeg OR FCSNVegGre > FCSVeg) FCSN_flag_veg = 1. | ||
| VARIABLE LABELS FCSN_flag_veg "Subgroup exceeds main group. Flag issue to team leader during high frequency check. During cleaning, recode value to be capped at value for main group". | ||
| VALUE LABELS FCSN_flag_veg | ||
| 0 "No" | ||
| 1 "Yes". | ||
|
|
||
| COMPUTE FCSN_flag_fruit = 0. | ||
| IF (FCSNFruiOrg > FCSFruit) FCSN_flag_fruit = 1. | ||
| VARIABLE LABELS FCSN_flag_fruit "Subgroup exceeds main group. Flag issue to team leader during high frequency check. During cleaning, recode value to be capped at value for main group". | ||
| VALUE LABELS FCSN_flag_fruit | ||
| 0 "No" | ||
| 1 "Yes". | ||
|
|
||
| *** Check flagged cases | ||
|
|
||
| FREQUENCIES VARIABLES = FCSN_flag_protein FCSN_flag_veg FCSN_flag_fruit | ||
| /ORDER = ANALYSIS. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Part of logical data cleaning steps |
||
|
|
||
| *** Calculate Vitamin A, protein and haem iron intake | ||
|
|
||
| COMPUTE FGVitA = FCSDairy + FCSNPrMeatO + FCSNPrEggs + FCSNVegOrg + FCSNVegGre + FCSNFruiOrg. | ||
| COMPUTE FGProtein = FCSPulse + FCSDairy + FCSNPrMeatF+ FCSNPrMeatO+ FCSNPrFish+ FCSNPrEggs. | ||
| COMPUTE FGHIron = FCSNPrMeatF+ FCSNPrMeatO + FCSNPrFish. | ||
|
|
||
| RECODE FGVitA (0 = 1) (1 THRU 6 = 2) (7 THRU 42 = 3) INTO VitA_Cat. | ||
| VARIABLE LABELS VitA_Cat 'Household consumption of vitamin A'. | ||
| VALUE LABELS VitA_Cat | ||
| 1 '0 time (never consumed)' | ||
| 2 '1-6 times (consumed sometimes)' | ||
| 3 '7 times or more (consumed at least daily)'. | ||
|
|
||
| RECODE FGProtein (0 = 1) (1 THRU 6 = 2) (7 THRU 42 = 3) INTO Protein_Cat. | ||
| VARIABLE LABELS Protein_Cat 'Household consumption of protein'. | ||
| VALUE LABELS Protein_Cat | ||
| 1 '0 time (never consumed)' | ||
| 2 '1-6 times (consumed sometimes)' | ||
| 3 '7 times or more (consumed at least daily)'. | ||
|
|
||
| RECODE FGHIron (0 = 1) (1 THRU 6 = 2) (7 THRU 42 = 3) INTO Haem_iron_Cat. | ||
| VARIABLE LABELS Haem_iron_Cat 'Household consumption of haem iron'. | ||
| VALUE LABELS Haem_iron_Cat | ||
| 1 '0 time (never consumed)' | ||
| 2 '1-6 times (consumed sometimes)' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. More of a question on the construction of the index, nothing to be addressed during review but for potential additional revision. |
||
| 3 '7 times or more (consumed at least daily)'. | ||
|
|
||
| *** Check results | ||
|
|
||
| *** Compute aggregates of key micronutrient consumption – vitamin, iron and protein | ||
| FREQUENCIES VARIABLES=VitA_Cat Protein_Cat Haem_iron_Cat | ||
| /ORDER=ANALYSIS. | ||
|
|
||
| Compute FGVitA = sum(FCSDairy, FCSNPrMeatO, FCSNPrEggs, FCSNVegOrg, FCSNVegGre, FCSNFruiOrg). | ||
| Variable labels FGVitA 'Consumption of vitamin A-rich foods'. | ||
| EXECUTE. | ||
| *** END OF SCRIPT | ||
|
|
||
| Compute FGProtein = sum(FCSPulse, FCSDairy, FCSNPrMeatF, FCSNPrMeatO, FCSNPrFish, FCSNPrEggs). | ||
| Variable labels FGProtein 'Consumption of protein-rich foods'. | ||
| EXECUTE. | ||
|
|
||
| Compute FGHIron = sum(FCSNPrMeatF, FCSNPrMeatO, FCSNPrFish). | ||
| Variable labels FGHIron 'Consumption of hem iron-rich foods'. | ||
| EXECUTE. | ||
|
|
||
| *** Recode into nutritious groups | ||
|
|
||
| Recode FGVitA (0=1) (1 thru 6=2) (7 thru 42=3) into FGVitACat. | ||
| Variable labels FGVitACat 'Consumption group of vitamin A-rich foods'. | ||
| EXECUTE. | ||
|
|
||
| Recode FGProtein (0=1) (1 thru 6=2) (7 thru 42=3) into FGProteinCat. | ||
| Variable labels FGProteinCat 'Consumption group of protein-rich foods'. | ||
| EXECUTE. | ||
|
|
||
| Recode FGHIron (0=1) (1 thru 6=2) (7 thru 42=3) into FGHIronCat. | ||
| Variable labels FGHIronCat 'Consumption group of hem iron-rich foods'. | ||
| EXECUTE. | ||
|
|
||
| *** Define variables labels and properties for "FGVitACat FGProteinCat FGHIronCat". | ||
|
|
||
| Value labels FGVitACat FGProteinCat FGHIronCat | ||
| 1.00 'Never consumed' 2.00 'Consumed sometimes' 3.00 'Consumed at least 7 times'. | ||
|
|
||
| EXECUTE. | ||
|
|
||
| *** End of Scripts | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing data imputation step: is it safe to assume every missing is 0?