Australian Longitudinal Study of Women’s Health (ALSWH) Analysis Code
R and Stata Analysis Code
This repository contains R code used in articles using the ALSWH.
Physical activity across midlife and health-related quality of life in Australian women: A target trial emulation using a longitudinal cohort
Code for all analysis in the article examining the causal effects of meeting physical activity on health-related quality of life (Nguyen-duy et al 2024) published in Plos Medicine: https://doi.org/10.1371/journal.pmed.1004384.
Description | R Code |
---|---|
1 - Data extraction - pull relevant variables from each wave | Data extraction |
2 - Merge data - merge waves and create derived variables | Merge data |
3 - Multiple imputation - impute intermittent missing data | Imputation |
4 - Final data creation - finalise imputed data and structure for analysis | Finalise data |
5 - LTMLE analysis - using dynamic regimes based on age, using the package ‘ltmle’ (1). | LTMLE analysis |
6 - Sensitivty analysis using lower physical activity cut-point. | Sensitivity 1 |
7 - Sensitivty analysis excluding variables wholly missing in some waves. | Sensitivity 1 |
8 - Pool results across imputations and create analysis figures | Pool results |
9 - Create plots of results using ggplot | Create plots |
10 - Generate ‘table 1’ of baseline descriptive statistics | Descriptives |
11 - E-value analysis to test sensitivity to unmeasured confounding | E-value analysis |
12 - Create summary of missing data | Missing data |
Causal effects of physical activity on mortality
Code for all analysis in the article examining the causal effects of meeting physical activity on mortality (Nguyen-duy et al 2025, under review).
Description | R Code |
---|---|
1 - Data extraction - pull relevant variables from each wave | Data extraction |
2 - Merge data - merge waves and create derived variables | Merge data |
3 - Multiple imputation - impute intermittent missing data | Imputation |
4 - Final data creation - finalise imputed data and structure for analysis | Finalise data |
5 - Analysis of all-cause mortality - using dynamic regimes based on age, using the package ‘ltmle’ (1). | All-cause analysis |
6 - Analysis of CVD mortality - using dynamic regimes based on age, using the package ‘ltmle’ (1). | CVD analysis |
7 - Analysis of Cancer mortality - using dynamic regimes based on age, using the package ‘ltmle’ (1). | Cancer analysis |
8 - Pool results across imputations and create analysis figures | Pool results |
9 - Create plots to graphically report the analysis findings | Create plots |
Causal effects of loneliness on all-cause mortality
Code for all analysis in the article examining the causal effects of loneliness on mortality (HaGani et al 2025, under review).
Description | R Code |
---|---|
1 - Data extraction - pull relevant variables from each wave | Data extraction |
2 - Merge data - merge waves and create derived variables | Merge data |
3 - Multiple imputation - impute intermittent missing data | Imputation |
4 - Final data creation - finalise imputed data and structure for analysis | Finalise data |
5 - Analysis of all-cause mortality - using dynamic regimes based on age, using the package ‘ltmle’ (1). | All-cause analysis |
6 - Post-hoc sensitivity analysis adjusting for baseline conditions rather than excluding. | Sensitivity |
7 - Pool results across imputations and create analysis figures | Pool results |
8 - Create plots to graphically report the analysis findings | Create plots |
9 - E-Value analysis of unmeasured confounding | EValue analysis |
10 - Missing data summary for appendix | Missing data |
11 - Descriptive statistics on unadjusted mortality incidence. | Mortality descriptives |
12 - Socio-demographic descriptives for Table 1. | Sociodemographic descriptives |
- Lendle SD, Schwab J, Petersen ML, van der Laan MJ. ltmle: An R Package Implementing Targeted Minimum Loss-Based Estimation for Longitudinal Data. Journal of Statistical Software. 2017;81(1):1-21.
- Vermunt JK. Latent Class Modeling with Covariates: Two Improved Three-Step Approaches. Political Analysis. 2010;18(4):450-469.