Health and Retirement Study (HRS) Cohort Analysis
R and Stata Analysis Code
This repository contains R and Stata code used in a number of articles using the Health and Retirement Study (HRS) Cohort Analysis (1).
When loneliness becomes a problem: Point prevalence and sustained loneliness comparisons in older American adults of the Health and Retirement Study
Code for all analysis in the article by Surkalim et al 2023, published in the Journals of Gerontology: https://doi.org/10.1093/geronb/gbad062
Description | Code |
---|---|
S1 - Data Cleaning in Stata | Data cleaning |
S2 - Imputation in R | Imputation |
S3 - Post-processing of imputed data in R | Post-processing |
S4 - Data finalise and import into Stata | Data finalise |
S5 - Sample characteristics | Sample characteristics |
S6 - Raw trends | Raw trends |
S7 - Trend analysis - sustained | Trend models - sustained |
S8 - Trend analysis - point | Trend models - point |
S9 - Trend analysis - scale indicator | Trend models - scale |
S10 - Multivariable analysis | Multivariable analysis |
Exercise to socialize? Bidirectional relationships between physical activity and loneliness in middle-aged and older American adults
Code for all analysis in the article by Surkalim et al 2024, published in the American Journal of Epidemiology: https://doi.org/10.1093/aje/kwae001
Description | Code |
---|---|
S0 - Data Cleaning in Stata | Data cleaning |
S1 - Imputation in R | Imputation |
S2 - Post-processing of imputed data in R | Post-processing |
S3 - RI-CLPM models using lavaan in R | RI-CLPM |
S4 - Pooled results from imputation using Rubin’s rules | Pooled results |
S5 - Mixed effects models for comparison purposes | GLMMS |
S6 - Socio-demographics table | Demographics |
- Sonnega A, Faul JD, Ofstedal MB, Langa KM, Phillips JWR, Weir DR. Cohort Profile: the Health and Retirement Study (HRS). International Journal of Epidemiology. 2014;43(2):576-85.