-
Notifications
You must be signed in to change notification settings - Fork 28
Update rCSI-indicator.sps #205
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
Open
odai-saleh
wants to merge
2
commits into
main
Choose a base branch
from
rCSI-update-Oct-2025
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
130 changes: 118 additions & 12 deletions
130
Indicators/Reduced-coping-strategy-index/rCSI-indicator.sps
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,122 @@ | ||
| * Encoding: UTF-8. | ||
| ***Reduced Coping Strategy Index*** | ||
| ***define variables | ||
|
|
||
| Variable labels | ||
| rCSILessQlty �Rely on less preferred and less expensive food in the past 7 days� | ||
| rCSIBorrow �Borrow food or rely on help from a relative or friend in the past 7 days� | ||
| rCSIMealNb �Reduce number of meals eaten in a day in the past 7 days� | ||
| rCSIMealSize �Limit portion size of meals at meal times in the past 7 days� | ||
| rCSIMealAdult �Restrict consumption by adults in order for small children to eat in the past 7 days�. | ||
|
|
||
| Compute rCSI = sum(rCSILessQlty*1,rCSIBorrow*2,rCSIMealNb*1,rCSIMealSize*1,rCSIMealAdult*3). | ||
| Variable labels rCSI 'Reduced coping strategies index (rCSI)'. | ||
| *** ---------------------------------------------------------------------------------------------------- | ||
|
|
||
| *** WFP Standardized Scripts | ||
| *** reduced Coping Strategies Index (rCSI) | ||
|
|
||
|
|
||
| *** Last Update: Oct 2025 | ||
| *** Purpose: This script calculates the reduced Coping Strategies Index | ||
|
|
||
| *** Data Quality Guidance References: | ||
| *** - Recommended high frequency checks: Page 31 | ||
| *** - Recommended cleaning steps: Page 38 | ||
|
|
||
| *** ---------------------------------------------------------------------------------------------------- | ||
|
|
||
| *** Define group labels- these should match Survey Designer naming conventions | ||
|
|
||
| VARIABLE LABELS | ||
| rCSILessQlty "Rely on less preferred and less expensive food in the past 7 days" | ||
| rCSIBorrow "Borrow food or rely on help from a relative or friend in the past 7 days" | ||
| rCSIMealNb "Reduce number of meals eaten in a day in the past 7 days" | ||
| rCSIMealSize "Limit portion size of meals at meal times in the past 7 days" | ||
| rCSIMealAdult "Restrict consumption by adults in order for small children to eat in the past 7 days". | ||
|
|
||
| *** Check individual strategies | ||
|
|
||
| FREQUENCIES VARIABLES=rCSILessQlty rCSIBorrow rCSIMealNb rCSIMealSize rCSIMealAdult | ||
| /FORMAT=NOTABLE | ||
| /STATISTICS=MINIMUM MAXIMUM MEAN. | ||
|
|
||
| *** Harmonize Data Quality Guidance measures | ||
| *** Clean impossible values | ||
|
|
||
| RECODE rCSILessQlty rCSIBorrow rCSIMealNb rCSIMealSize rCSIMealAdult (LOWEST THRU -1 = SYSMIS). | ||
| RECODE rCSILessQlty rCSIBorrow rCSIMealNb rCSIMealSize rCSIMealAdult (8 THRU HIGHEST = SYSMIS). | ||
| EXECUTE. | ||
|
|
||
| *** Calculate rCSI (use + instead of SUM to automatically drop missing values from the final rCSI) | ||
|
|
||
| COMPUTE rCSI = (rCSILessQlty*1) + (rCSIBorrow*2) + (rCSIMealNb*1) + (rCSIMealSize*1) + (rCSIMealAdult*3). | ||
| VARIABLE LABELS rCSI 'Reduced coping strategies index (rCSI)'. | ||
| EXECUTE. | ||
|
|
||
| *** Harmonize Data Quality Guidance measures | ||
| *** Check that rCSI is between 0-56 | ||
|
|
||
| DESCRIPTIVES VARIABLES=rCSI | ||
| /STATISTICS=MEAN STDDEV MIN MAX. | ||
|
|
||
| *** Clean any impossible FCS values | ||
|
|
||
| RECODE rCSI (LOWEST THRU -1 = SYSMIS). | ||
| RECODE rCSI (57 THRU HIGHEST = SYSMIS). | ||
| EXECUTE. | ||
|
|
||
| *** Flagging potential Data Quality issues. If any cases reflected here, refer to the Data Quality Guidance note page 31. This can be found on the VAM Ressource Centre, | ||
| *** Note that having a low rCSI is likely not a data quality issue if the area surveyed is relatively food secure | ||
| *** Note that having a high rCSI can be real if the area surveyed is very food insecure | ||
|
|
||
| COMPUTE rCSI_flag_low = 0. | ||
| IF (rCSI LE 3) rCSI_flag_low = 1. | ||
| VARIABLE LABELS rCSI_flag_low "rCSI has low values that could be a Data Quality issue unless the population surveyed is generally food secure. Flag to team leader if poor or boderline FCS". | ||
| VALUE LABELS rCSI_flag_low | ||
| 0 "No" | ||
| 1 "Yes". | ||
|
|
||
| COMPUTE rCSI_flag_high = 0. | ||
| IF (rCSI GE 42) rCSI_flag_high = 1. | ||
| VARIABLE LABELS rCSI_flag_high "rCSI has high values that could be a Data Quality issue unless the population surveyed is generally food insecure. Flag to team leader if acceptable FCS, low levels of livelihood coping etc". | ||
| VALUE LABELS rCSI_flag_high | ||
| 0 "No" | ||
| 1 "Yes". | ||
|
|
||
| *** Check flagged cases | ||
| *** If it is found that flags might be data quality issues (i.e. high number of flag_low in very food insecure areas or flag_high in seeminly food secure areas), | ||
| it is recommended to do a crosstab to see the frequency by enumerator to understand if flags are coming from the same few enumerators | ||
|
|
||
| FREQUENCIES VARIABLES=rCSI_flag_low rCSI_flag_high | ||
| /ORDER=ANALYSIS. | ||
|
|
||
| *** Check distribution of final categories | ||
|
|
||
| FREQUENCIES VARIABLES=rCSI | ||
| /FORMAT=NOTABLE | ||
| /STATISTICS=MINIMUM MAXIMUM MEAN. | ||
|
Comment on lines
+57
to
+86
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. Suggest to include in outlier detection |
||
|
|
||
| *** Optional: Compute the same variable to be used directly for IPC analysis (referring to IPC phases) | ||
|
|
||
| RECODE rCSI (LOWEST THRU 3 = 1) (4 THRU 18 = 2) (19 THRU HIGHEST = 3) INTO rCSI_IPC. | ||
| VARIABLE LABELS rCSI_IPC "Official IPC Classification for rCSI". | ||
| VALUE LABELS rCSI_IPC | ||
| 1 "rCSI [0-3] - IPC Phase 1" | ||
| 2 "rCSI [4-18] - IPC Phase 2" | ||
| 3 "rCSI [>=19] - IPC Phase 3-5". | ||
| EXECUTE. | ||
|
|
||
| *** Check distribution of final categories | ||
|
|
||
| FREQUENCIES VARIABLES=rCSI_IPC | ||
| /ORDER=ANALYSIS. | ||
|
|
||
| *** Optional: Compute the same variable to be used directly for IPC analysis (referring to IPC phases) - indicating high values (potential Phase 4) | ||
|
|
||
| RECODE rCSI (LOWEST THRU 3 = 1) (4 THRU 18 = 2) (19 THRU 42 = 3) (43 THRU HIGHEST = 4) INTO rCSI_IPC_HighValues. | ||
| VARIABLE LABELS rCSI_IPC_HighValues "Informal IPC Classification indicating high values (potential Phase 4)". | ||
| VALUE LABELS rCSI_IPC_HighValues | ||
| 1 "rCSI [0-3] - IPC Phase 1" | ||
| 2 "rCSI [4-18] - IPC Phase 2" | ||
| 3 "rCSI [19-42] - IPC Phase 3" | ||
| 4 "rCSI [>42] - IPC Phase 4". | ||
| EXECUTE. | ||
|
|
||
| *** Check distribution of final categories | ||
|
|
||
| FREQUENCIES VARIABLES=rCSI_IPC_HighValues | ||
| /ORDER=ANALYSIS. | ||
|
Comment on lines
+87
to
+117
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. Suggest to include in IPC analysis dedicated script. |
||
|
|
||
| *** ---------------------------------------------------------------------------------------------------- | ||
| *** END OF SCRIPT | ||
| *** ---------------------------------------------------------------------------------------------------- | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Suggest to move to logical cleaning