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'
收藏资源简介:
Code to reproduce the analyses in the study '<strong>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'</strong> 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<br> DEMO_H.XPT<br> FSQ_H.XPT<br> BMX_H.XPT # Summary files of food recalls<br> DR1TOT_H.XPT<br> DR2TOT_H.XPT # Individual foods files from food recalls<br> DR1FF_H.XPT<br> DR2FF_H.XPT The second R script takes the .csv file output by the merging script, and reproduces the analyses and figures described in the paper. Initially uploaded by Daniel Nettle, April 23rd 2019. Slightly revised versions uploaded August 6th 2019 by Daniel Nettle.
本代码用于复现研究**《粮食不安全女性的饮食多样性更低且饮食模式时间波动性更强:基于2013-2014年美国全国健康与营养调查的证据》**中的分析内容。本分析需使用两份R脚本,以及可从美国全国健康与营养调查(National Health and Nutrition Examination Survey, NHANES)官方网站(https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx?BeginYear=2013)下载的对应原始数据文件。 第一份R脚本为「合并脚本.r」,其功能为读取原始NHANES数据文件,提取研究所需变量,将各数据集合并为单个数据框,并以.csv格式保存输出。该脚本所需的原始数据文件包括: 1. 人口统计学、粮食不安全状况与身体质量指数(Body Mass Index, BMI)相关文件:DEMO_H.XPT、FSQ_H.XPT、BMX_H.XPT 2. 食物召回汇总文件:DR1TOT_H.XPT、DR2TOT_H.XPT 3. 食物召回中的单个食物条目文件:DR1FF_H.XPT、DR2FF_H.XPT 第二份R脚本可读取合并脚本生成的.csv输出文件,复现论文中所述的全部分析与图表。 本代码最初由Daniel Nettle于2019年4月23日上传,其后于2019年8月6日由其发布了小幅修订版本。



