Projection of US adult obesity trends based on individual BMI trajectories 1. Data Data from the National Health and Nutrition Examination Survey (NHANES) are freely available at [https://www.cdc.gov/nchs/nhanes/](https://www.cdc.gov/nchs/nhanes/). Details on the variables used here may be found in script `R_preparation/variables_description.R`. 2. Preparation of data (`R_preparation`) The data for functional data analysis is prepared executing `main_prep.R`, in the `R_preparation` folder. The MATLAB code (folder `matlab/nhanes/`) is called from within R. The source code of the **BFDA toolbox** is modified only so as to save to csv files the posterior sample of individual trajectories. NB: Dependencies of the BFDA toolbox (e.g. mcmcdiag) are **not** included in this repository. They can all be downloaded from [BFDA's homepage](https://github.com/yjingj/BFDA). ## Analysis of results (`R_analysis`) Analysis of results of BFDA (e.g. computation of prevalence obese or of time spent obese) is conducted in the `R_analysis` folder. Start from the `main.R` script. 4. `bmi.utils` A minimal R package that groups functions used for the preparation and analysis steps. 5. List of scripts in R_preparation and R_analysis R_preparation folder main_prep.R : main file for the preparation of data regions_comparison.R: draw graphs showing on which regions of the CohortxAge plane measured and reported past BMIs can be compared graph_recall1y10y.R: compare reported past BMIs (1yr and 10yrs before survey) to measured BMIs graph_recall25.R: compare reported past BMIs (BMI at age 25) to measured BMIs variables_description.R: description of NHANES variables used descriptive_stat folder change_smoking.R: draw changing smoking prevalence at age 25 by sex and birth cohort change_ethnicity.R: draw changing ethnic composition by sex and birth cohort change_education.R: draw changing educational attainments by sex and birth cohort plot_bmi_traj_f.R: function to plot individual bmi trajectories plot_bmi_traj.R: effectively draw trajectories smoking_continuation.R: plot association between smoking status at age 25 and current smoking status for those with 'completed' smoking history load_other_nhanes nhanesII.R: load data from NHANES III (1976-1980) to assess bias specific to reported past BMIs nhanesIII.R: load data from NHANES III (1988-1994) to assess bias specific to reported past BMIs R_analysis folder main_analysis.R: main script for the analysis of FDA results prevalence.R: compute prevalence of obesity and severe obesity at age 55 by cohort prevalence_race.R: compute prevalence of obesity at age 55 by race and cohort prevalence_young.R: compute prevalence of obesity and severe obesity by cohort at age 35 tso.R: compute time spent being obese tso_obese.R: compute time spent being obese by those obese at age 55 R version: 3.6.0