Dataset Open Access

Code for 'Food-insecure women eat a less diverse diet in a more temporally variable way: Evidence from the US National Health and Nutrition Examination Survey, 2013-4'

Nettle, Daniel; Bateson, Melissa

Code to reproduce the analyses in the study 'Food-insecure women eat a less diverse diet in a more temporally variable way: Evidence from the US National Health and Nutrition Examination Survey, 2013-4'

The analysis requires two R scripts available here, plus original 2013-4 NHANES data files, downloadable from the NHANES website (https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2013).

The first R script, 'merging script.r' takes the original NHANES files, extracts the variables required for the study, merges them into a single data frame, and saves this in .csv format. The NHANES files it requires are:

# Demographics, food insecurity and BMI
DEMO_H.XPT
FSQ_H.XPT
BMX_H.XPT

# Summary files of food recalls
DR1TOT_H.XPT
DR2TOT_H.XPT

# Individual foods files from food recalls
DR1FF_H.XPT
DR2FF_H.XPT

The second R script takes the .csv file output by the merging script, and reproduces the analyses described in the paper.

Uploaded by Daniel Nettle, April 23rd 2019.

Files (33.9 kB)
Name Size
analysis script.r
md5:ff9f0f77d0cd99e3d0a312abb3710c03
23.8 kB Download
merging script.r
md5:667e00689ea5642b5330e5bf5c493313
9.8 kB Download
NHANES files used in study.txt
md5:c47c89b054629241504026ff92718aa8
311 Bytes Download
7
3
views
downloads
All versions This version
Views 77
Downloads 33
Data volume 33.9 kB33.9 kB
Unique views 77
Unique downloads 11

Share

Cite as