- R 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| Code | ||
| Data | ||
| Results | ||
| README.md | ||
Heat_AC_Use_Mortality_US
These sample codes and data are attached to the paper titled "Averted Heat-Related Mortality in the United States from Air Conditioning Usage" by Chu et al. In this paper, we designed a time-stratified case-crossover study combined with two-stage models to evaluate the role of household air conditioning (AC) usage in the temperature-mortality associations.
We conducted the analyses in R-4.4.2. All files are expected to run within 1 minute on the sample data, respectively.
####### Sample data We are not allowed to disclose the real health data. We used the chicagoNMMAPS dataset from the "dlnm" package as sample data.
####### "Codes" folder 1.Clean_Chicago_data.R: (1) To mimic our real data, the Chicago data was re-organized into individual-level data. (2) We picked controls for the cases under a time-stratified case-crossover design. (3) Lagged exposures were linked to each case and control. (4) To illustrate the idea of two-stage models, individuals in the Chicago data were randomly assigned to seven counties.
2.First_stage_model.R: We modelled county-specific temperature-mortality associations incorporating distributed lag non-linear models and conditional logistic regression.
3.Second_stage_meta_regression.R: We pooled county-specific associations with meta regression on county-level household AC usage and socio-demographic and climate covariates. For simplicity, the covariates were omitted in the sample code.
4.Prediction.R: We predicted the temperature-mortality curve at the AC usage levels of interest.
"Data" folder:
- Data.0-4.rds files were step-by-step cleaned Chicago data, generated by 1.Clean_Chicago_data.R
- Data.Z.Fake_AC.rds included fake county-level average household AC usage data (generated in 3.Second_stage_meta_regression.R).
"Results" folder:
- This folder included intermediate results (i.e., county-specific modeling estimates and meta regression outputs), generated by 2.First_stage_model.R and 3.Second_stage_meta_regression.R.
- An example of the temperature-mortality curve when AC usage=1300 kWh was provided in this folder, named "Figure.Temp_mortality_curve_ac1300.tiff."