Skip to content

Commit 8d0bfe2

Browse files
Proofing
1 parent 44e3525 commit 8d0bfe2

21 files changed

+24
-13
lines changed

1b_CompositionSummary.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ tot_spec <- do.call(rbind, dlist_spec)
2121
#Useful objects for later
2222
spec_inds <- grep("PM25", colnames(tot_spec))
2323
spec_names <- c("SO4", "NH4", "NO3", "BC", "OC", "SS", "DUST")
24-
spec_labs <- c(expression(SO[4]^{"2-"}), expression(NH[4]^{"+"}), expression(NO[3]^{"-"}),
25-
"BC", "OC", "SS", "DUST")
24+
spec_labs <- c(expression(SO[4]^{"2-"}), expression(NH[4]^{"+"}),
25+
expression(NO[3]^{"-"}), "BC", "OC", "Sea salt", "Dust")
2626
spec_pal <- c(2, 6, 4, 1, 3, 5, 7)
2727

2828
# Zeros imputation
@@ -90,8 +90,10 @@ mean_comp <- t(mean_comp)
9090
p <- ncol(mean_comp)
9191
colnames(mean_comp) <- spec_names
9292
var_mat <- variation(acomp(mean_comp))
93+
spec_labs[6] <- expression("SS")
9394
colnames(var_mat) <- rownames(var_mat) <- paste(":", spec_labs)
9495

96+
9597
# Color palette
9698
colpal <- colorRampPalette(c('#FFFFFF', '#D1E5F0', '#92C5DE',
9799
'#4393C3', '#2166AC', '#053061'))(20)
@@ -100,5 +102,5 @@ x11()
100102
corrplot.mixed(var_mat, is.corr = F, tl.col = spec_pal, tl.cex = 1.5,
101103
lower.col = colpal, upper.col = colpal)
102104

103-
dev.print(pdf, file = "Results/eFigure7.pdf")
105+
dev.print(png, file = "Results/eFigure7.png", res = 1000, units = "in")
104106

3_SecondStage_MetaRegComposition.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ load("Data/2_FirstStageResults.RData")
2424
spec_inds <- grep("PM25", colnames(dlist_spec[[1]]))
2525
spec_names <- c("SO4", "NH4", "NO3", "BC", "OC", "SS", "DUST")
2626
spec_labs <- c(expression(SO[4]^{"2-"}), expression(NH[4]^{"+"}),
27-
expression(NO[3]^{"-"}), "BC", "OC", "SS", "DUST")
27+
expression(NO[3]^{"-"}), "BC", "OC", "Sea salt", "Dust")
2828
spec_pal <- c(2, 6, 4, 1, 3, 5, 7)
2929

3030
# Mean per city
@@ -208,7 +208,7 @@ pm <- rbind(c(9, rep(10, 3)),
208208

209209
# Initialize plot
210210
x11(height = 10, width = 15)
211-
par(mar = c(5, 5, 3, 1), cex.main = 1.5, cex.lab = 1.2)
211+
par(mar = c(5, 6, 3, 1), cex.main = 1.5, cex.lab = 1.2)
212212
layout(pm, width = c(.4, .2, .2, .2), height = c(.1, .3, .3, .3))
213213

214214
#----- Panel A: meta-coefficients

4_SupplementaryResults.R

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ legend("topright", legend = unique(cities$region),
5656
inset = .02, ncol = 1, xpd = T
5757
)
5858

59-
dev.print(pdf, file = "Results/eFigure1.pdf")
59+
dev.print(png, filename = "Results/eFigure1.png", res = 1000, units = "in")
6060

6161
#-------------------------------------
6262
# Supplemental Material B: Residual Analysis
@@ -70,7 +70,7 @@ x11()
7070
hist(resvec, border = "white", col = 4, xlab = "Residuals", freq = F,
7171
main = "")
7272

73-
dev.print(pdf, file = "Results/eFigure2.pdf")
73+
dev.print(png, file = "Results/eFigure2.png", res = 1000, units = "in")
7474

7575
#---- Plot residuals by region ----
7676

@@ -97,7 +97,7 @@ abline(h = 0)
9797
legend(par("usr")[2], par("usr")[4], unique(cities_ord$region), pch = reg_pch,
9898
col = reg_pal, bty = "n", xpd = T, title = "Region")
9999

100-
dev.print(pdf, file = "Results/eFigure3.pdf")
100+
dev.print(png, file = "Results/eFigure3.png", res = 1000, units = "in")
101101

102102
#---- Plot residuals by components ----
103103
pm <- matrix(c(1:6, 0, 7, 0), nrow = 3, byrow = T)
@@ -111,7 +111,7 @@ for (j in seq(p)){
111111
main = bquote(bold(.(spec_labs[j][[1]]))))
112112
}
113113

114-
dev.print(pdf, file = "Results/eFigure4.pdf")
114+
dev.print(png, file = "Results/eFigure4.png", res = 1000, units = "in")
115115

116116
#---- Check extreme residuals ----
117117
res_sort <- order(resvec)
@@ -141,7 +141,7 @@ legend(par("usr")[2], with(lg$rect, top - h),
141141
c("Observed range", "Extrapolation"), lwd = c(3, 1), lty = 1:2, bty = "n",
142142
xpd = T, y.intersp = 1.2, col = grey(.5))
143143

144-
dev.print(pdf, file = "Results/eFigure5.pdf")
144+
dev.print(png, file = "Results/eFigure5.png", res = 1000, units = "in")
145145

146146
#----- Plot ternary diagram with predictions -----
147147
## Create function to predict for Ternary plot
@@ -210,7 +210,7 @@ image.plot(zlim = c(0.985, 1.015), col = colpal(20),
210210
legend.only = T, xpd = T, smallplot = c(0, .05, 0.2, .8))
211211
text(0, .92, "RR", xpd = T, cex = 1.5)
212212

213-
dev.print(pdf, file = "Results/eFigure6.pdf")
213+
dev.print(png, file = "Results/eFigure6.png", res = 1000, units = "in")
214214

215215

216216
#-------------------------------------

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
# Differential mortality risks associated to PM2.5 components: a multi-country multi-city study.
22

3-
Reproducible R code and results for the publication
3+
R code and results attached to the publication:
44

55
Masselot P, et al. Differential mortality risks associated to PM2.5 components: a multi-country multi-city study. *Epidemiology*. In press.
66

77
### Data and Results
88

9-
Figures and Tables (including supplemental ones) are available in the Results folder of this repository. Data are not available currently due to restricted data sharing agreement between the collaborators of this study.
9+
**Data are not available currently due to restricted data sharing agreement between the collaborators of this study. Therefore, the code is not fully reproducible.**
10+
11+
Data are normally included in a subfolder *Data*. It should contain:
12+
- Mortality and pollution data, stored in a list of city-specific data.frames. Also contains a descriptive data.frame with one line for each city.
13+
- PM2.5 components, stored in one csv files per year of data. Each csv file contains one line per city.
14+
- City-specific characteristics, stored as a data.frame with one line per city.
1015

1116
### R code
1217

@@ -18,3 +23,7 @@ The R code to reproduce the analysis is available. Scripts are meant to be execu
1823
- *2_FirstStage.R* Runs the first-stage model on each selected city to produce city-level relative risks.
1924
- *3_SecondStage_MetaRegComposition.R* Pools first-stage results in a meta analysis including city-specific compositions and socio-economic indicators. Produces Figures 1 and 3 as well as several eFigures.
2025
- *4_SupplementaryResults.R* Produces several supplementary results and eFigures, including the PCA summary and residuals analysis.
26+
27+
### Results
28+
29+
Figures and Tables generated for the publication (including supplemental ones) are available in the Results folder of this repository.

Results/Figure1.pdf

-1.93 KB
Binary file not shown.

Results/Figure2.pdf

10 Bytes
Binary file not shown.

Results/Figure3.pdf

22 Bytes
Binary file not shown.

Results/eFigure1.pdf

-15 KB
Binary file not shown.

Results/eFigure1.png

632 KB
Loading

Results/eFigure2.pdf

-4.15 KB
Binary file not shown.

Results/eFigure2.png

106 KB
Loading

Results/eFigure3.pdf

-9.58 KB
Binary file not shown.

Results/eFigure3.png

215 KB
Loading

Results/eFigure4.pdf

-84.9 KB
Binary file not shown.

Results/eFigure4.png

364 KB
Loading

Results/eFigure5.pdf

-8.43 KB
Binary file not shown.

Results/eFigure5.png

216 KB
Loading

Results/eFigure6.pdf

-503 KB
Binary file not shown.

Results/eFigure6.png

925 KB
Loading

Results/eFigure7.pdf

-7.39 KB
Binary file not shown.

Results/eFigure7.png

454 KB
Loading

0 commit comments

Comments
 (0)