Skip to content

Conversation

@odai-saleh
Copy link

No description provided.

Copy link
Contributor

@ValerioGiuffrida ValerioGiuffrida left a comment

Choose a reason for hiding this comment

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

@odai-saleh suggested changes are part of this review.
Generally the code mixes elements of indicator calculation with outlier detection and imputation.
This will create issues in the use of the code for automations.

Comment on lines +35 to 40
*** 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.
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.

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

Comment on lines +101 to +122
*** 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.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants