################################################################################ # R code to construct histogram of PM2.5 data for Example 1 # ################################################################################ X1 <- c(2.2,19.2,42.4,53.8,7.1,2.0,31.1,6.1,12.3,14.9,1.6,17.9,30.7,29.4,18.3,7.9,15.9,29.6,44.6,11.9,8.3,6.2,6.7,13.5,15.0,10.0,9.6,30.9,6.4,8.1) Northern <- log(X1) hist(Northern,xlab="log-daily rainfall (mm)",xlim=c(0,10),ylim=c(0,15),main="") X2 <- c(7.1,4.0,6.5,6.4,1.4,0.4,2.9,4.2,4.0,155.4,0.7,1.8,2.3,0.2,1.2,4.3,57.7,2.9,0.9,1.7,52.3,41.8,5.1,5.7,40.5,42.1,38.5,2.0,12.3,1.2,15.4) Northeastern <- log(X2) hist(Northeastern,xlab="log-daily rainfall (mm)",xlim=c(0,10),ylim=c(0,15),main="") X3 <- c(0.2,4.9,9.1,24.2,32.8,45.2,21.7,11.1,9.3,12.1,3.0,44.8,12.4,0.2,12.4,31.7,36.4,39.3,14.2,7.7,3.9) Central <- log(X3) hist(Central,xlab="log-daily rainfall (mm)",xlim=c(0,10),ylim=c(0,15),main="") X4 <- c(36.4,31.8,16.7,4.8,10.9,59.7,12.0,38.8,0.3,30.0,16.1,2.5,15.4,9.9,10.0,24.2) Eastern <- log(X4) hist(Eastern,xlab="log-daily rainfall (mm)",xlim=c(0,10),ylim=c(0,15),main="") X5 <- c(0.8,2.1,23.6,0.6,0.4,1.3,5.3,15.9,50.5,2.8,0.2,0.4,7.0,35.4,13.4,53.9,24.7,2.5,27.2,32.8,51.6,5.4,20.2,98.6,12.6,5.8,1.4) Southern <- log(X5) hist(Southern,xlab="log-daily rainfall (mm)",xlim=c(0,10),ylim=c(0,15),main="") ############################################################################### # R code to compute p-values and to construct the normal Q-Q plot # # of PM2.5 data for Example 1 # ############################################################################### library(MASS) shapiro.test(Northern) qqnorm(Northern) qqline(Northern) shapiro.test(Northeastern) qqnorm(Northeastern) qqline(Northeastern) shapiro.test(Central) qqnorm(Central) qqline(Central) shapiro.test(Eastern) qqnorm(Eastern) qqline(Eastern) shapiro.test(Southern) qqnorm(Southern) qqline(Southern)