-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathnep.Rmd
More file actions
72 lines (53 loc) · 2.25 KB
/
nep.Rmd
File metadata and controls
72 lines (53 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
---
title: "nonedible.portions.fctmatch"
author: "Kevin Tang"
date: "11/12/2020"
output: html_document
editor_options:
chunk_output_type: inline
---
> Packages
```{r}
library(epiDisplay)
library(foreign)
library(psych)
library(tidyverse)
```
>Data
```{r}
ihs4 <- read.csv("/Users/kevintang/Documents/ihs4/data/ihs4/hh_mod_g_processed.csv")
nep <- read.csv("/Users/kevintang/Documents/ihs4/data/nutrient.supply/nep.factors.csv")
foodgroup <- read.csv("/Users/kevintang/Documents/ihs4/data/nutrient.supply/foodgroup.csv")
fctmatch <- read.csv("/Users/kevintang/Documents/ihs4/data/fct.match/fct.match.v2.csv")
```
>Non-edible portions of food items
This step requires us to eliminate food weight that would have been recalled as part of the HCES questionnaire, but would not have actually been consumed due to processing or preparation. This includes parts of food like banana peels, skins of fruits and tubers that would have been peeled, bones of large fish that would have been discarded etc.
For these data, we conducted a similar matching process that done for food composition matching, except we used "non-edible food portions". These values are not available in MAFOODS, KENFCT, or LSOFCT so we opted for the values provided in the FAO West African FCTs. Missing values were filled in with assumptions and should be cross referenced to the USDA Food Composition Database.
```{r}
nep <- nep %>% select(item_code, nep)
nep$nep <-as.numeric(nep$nep)
ihs4 <- merge(x=ihs4, y=nep , by.x='item_code', by.y='item_code', fill=-9999, all.x = TRUE) %>% arrange(HHID)
ihs4$kg_d_nep <- ihs4$kg_d2 * ihs4$nep
ihs4$g100_d_nep <-ihs4$kg_d_nep*10
```
>Labeling food groups of food items
We need to add a variable to group items by the food group that a food item fell under according to the IHS. There are 11 food groups in total:
-Cereals/grains
-Roots/tubers/plantains
-Nuts/pulses
-Vegetables
-Meat/animal products
-Fruit
-Dairy
-Fats
-Spices/misc
-Vendor food
-Beverages
```{r}
ihs4 <- merge(x=ihs4, y=foodgroup, by.x='item_code', by.y='code', fill=-9999, all.x = TRUE) %>% arrange(item_code) %>% arrange(HHID)
```
> DONE: archive
```{r}
ihs4 <- ihs4 %>% select(HHID, item_code, g100_d_nep, food.group)
write.csv(ihs4, "/Users/kevintang/Documents/ihs4/data/ihs4/hh_mod_g_nep.csv")
```