INSTALLING REQUIRED PACKAGES

library(readr)
library(plyr)
library(dplyr)
library(tidyr)
library(car)
library(mosaic)
library(outliers)
library(forecast)
library(e1071)

DATA

We are using the data from a opean source website “https://data.gov.in/

https://data.gov.in/resources/location-wise-daily-ambient-air-quality-gujarat-year-2015 which is for RSPM_Gujarat

https://data.gov.in/resources/location-wise-daily-ambient-air-quality-delhi-year-2015 which is forRSPM_Delhi

The Rpub link on which the assignment submitted is http://rpubs.com/Tarun_S_Sarode/393976

The data include the following :

>Stn Code : Station Code

>Sampling Date : The date on which the sampling is done.

>State : The state’s in which the the survey is done.

>City/Town/Village/Area : Division of the state through region.

>Location of Monitoring Station : The location where the survey was done.

>Agency : The agency who did the survey.

>Type of Location : Location divided as Resendential or Rural.

>SO2 : Sulphur Dioxide.

>NO2 : Nitrogen Dioxide.

>RSPM/PM10 : Particular Matter (Size less than 10).

>PM 2.5 : Particular Matter (Size less than 2.5).

Importing Data

RSPM_Delhi <- read.csv("RSPM Delhi.csv")
RSPM_Delhi$NO2_limit<-c(80)
head(RSPM_Delhi)
##   Stn.Code Sampling.Date State City.Town.Village.Area
## 1       55     5/01/2015 Delhi                  Delhi
## 2       55     8/01/2015 Delhi                  Delhi
## 3       55    13/01/2015 Delhi                  Delhi
## 4       55    16/01/2015 Delhi                  Delhi
## 5       55    21/01/2015 Delhi                  Delhi
## 6       55    27/01/2015 Delhi                  Delhi
##   Location.of.Monitoring.Station                          Agency
## 1              Nizamuddin, Delhi Central Pollution Control Board
## 2              Nizamuddin, Delhi Central Pollution Control Board
## 3              Nizamuddin, Delhi Central Pollution Control Board
## 4              Nizamuddin, Delhi Central Pollution Control Board
## 5              Nizamuddin, Delhi Central Pollution Control Board
## 6              Nizamuddin, Delhi Central Pollution Control Board
##                     Type.of.Location SO2 NO2 RSPM.PM10 PM.2.5 NO2_limit
## 1 Residential, Rural and other Areas   4  44       203     NA        80
## 2 Residential, Rural and other Areas   4  45       214     NA        80
## 3 Residential, Rural and other Areas   4  47       182     NA        80
## 4 Residential, Rural and other Areas   4  43       204     78        80
## 5 Residential, Rural and other Areas   4  39       192     83        80
## 6 Residential, Rural and other Areas   4  46       159    146        80

In the above code we are importing the data and creating a new column NO2_limit = 80 which is the limit for the gas NO2 to be present in the air in Delhi and is used further for calculations

RSPM_Gujrat <- read.csv("RSPM Gujrat.csv")
RSPM_Gujrat$NO2_limit<-c(30)
head(RSPM_Gujrat)
##   Stn.Code Sampling.Date   State City.Town.Village.Area
## 1       21     5/01/2015 Gujarat                  Surat
## 2       21     8/01/2015 Gujarat                  Surat
## 3       21    12/01/2015 Gujarat                  Surat
## 4       21    15/01/2015 Gujarat                  Surat
## 5       21    19/01/2015 Gujarat                  Surat
## 6       21    22/01/2015 Gujarat                  Surat
##   Location.of.Monitoring.Station                                Agency
## 1    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
## 2    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
## 3    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
## 4    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
## 5    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
## 6    S.V.R. Engg. College, Surat Gujarat State Pollution Control Board
##                     Type.of.Location SO2 NO2 RSPM.PM10 PM.2.5 NO2_limit
## 1 Residential, Rural and other Areas  13  20        86     28        30
## 2 Residential, Rural and other Areas  13  19        73     25        30
## 3 Residential, Rural and other Areas  14  22        88     32        30
## 4 Residential, Rural and other Areas  12  19        86     30        30
## 5 Residential, Rural and other Areas  13  21        78     27        30
## 6 Residential, Rural and other Areas  14  22        75     32        30

In the above code we are importing the data and creating a new column NO2_limit = 80 which is the limit for the gas NO2 to be present in the air in Gujarat and is used further for calculations

Merging Data

RSPM<-rBind(RSPM_Delhi,RSPM_Gujrat)
head(RSPM)
##   Stn.Code Sampling.Date State City.Town.Village.Area
## 1       55     5/01/2015 Delhi                  Delhi
## 2       55     8/01/2015 Delhi                  Delhi
## 3       55    13/01/2015 Delhi                  Delhi
## 4       55    16/01/2015 Delhi                  Delhi
## 5       55    21/01/2015 Delhi                  Delhi
## 6       55    27/01/2015 Delhi                  Delhi
##   Location.of.Monitoring.Station                          Agency
## 1              Nizamuddin, Delhi Central Pollution Control Board
## 2              Nizamuddin, Delhi Central Pollution Control Board
## 3              Nizamuddin, Delhi Central Pollution Control Board
## 4              Nizamuddin, Delhi Central Pollution Control Board
## 5              Nizamuddin, Delhi Central Pollution Control Board
## 6              Nizamuddin, Delhi Central Pollution Control Board
##                     Type.of.Location SO2 NO2 RSPM.PM10 PM.2.5 NO2_limit
## 1 Residential, Rural and other Areas   4  44       203     NA        80
## 2 Residential, Rural and other Areas   4  45       214     NA        80
## 3 Residential, Rural and other Areas   4  47       182     NA        80
## 4 Residential, Rural and other Areas   4  43       204     78        80
## 5 Residential, Rural and other Areas   4  39       192     83        80
## 6 Residential, Rural and other Areas   4  46       159    146        80

We merge the RSPM_Delhi and RSPM_Gujrat data

We have assigned a new variable “RSPM”to the merged data

Conversion of Data Type

str(RSPM)
## 'data.frame':    1825 obs. of  12 variables:
##  $ Stn.Code                      : chr  "55" "55" "55" "55" ...
##  $ Sampling.Date                 : Factor w/ 297 levels "1/01/2015","1/04/2015",..: 208 232 32 59 110 161 94 209 9 33 ...
##  $ State                         : Factor w/ 2 levels "Delhi","Gujarat": 1 1 1 1 1 1 1 1 1 1 ...
##  $ City.Town.Village.Area        : Factor w/ 15 levels "Delhi","Ahmedabad",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Location.of.Monitoring.Station: Factor w/ 41 levels "Janakpuri, Delhi",..: 4 4 4 4 4 4 4 4 4 4 ...
##  $ Agency                        : Factor w/ 3 levels "Central Pollution Control Board",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Type.of.Location              : Factor w/ 3 levels "Industrial Area",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ SO2                           : int  4 4 4 4 4 4 4 4 4 4 ...
##  $ NO2                           : int  44 45 47 43 39 46 41 50 48 45 ...
##  $ RSPM.PM10                     : int  203 214 182 204 192 159 267 235 241 280 ...
##  $ PM.2.5                        : int  NA NA NA 78 83 146 62 112 62 NA ...
##  $ NO2_limit                     : num  80 80 80 80 80 80 80 80 80 80 ...

We can see that the data includes characters, numbers and integers

We will change the character to Factor data type of City/Town/Village/Area, Location of Monitoring Station, Type of Location, Agency

RSPM$City.Town.Village.Area<- as.factor(RSPM$City.Town.Village.Area)
RSPM$Location.of.Monitoring.Station <- as.factor(RSPM$Location.of.Monitoring.Station)
RSPM$Type.of.Location <- as.factor(RSPM$Type.of.Location)
RSPM$Agency <- as.factor(RSPM$Agency)
str(RSPM)
## 'data.frame':    1825 obs. of  12 variables:
##  $ Stn.Code                      : chr  "55" "55" "55" "55" ...
##  $ Sampling.Date                 : Factor w/ 297 levels "1/01/2015","1/04/2015",..: 208 232 32 59 110 161 94 209 9 33 ...
##  $ State                         : Factor w/ 2 levels "Delhi","Gujarat": 1 1 1 1 1 1 1 1 1 1 ...
##  $ City.Town.Village.Area        : Factor w/ 15 levels "Delhi","Ahmedabad",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Location.of.Monitoring.Station: Factor w/ 41 levels "Janakpuri, Delhi",..: 4 4 4 4 4 4 4 4 4 4 ...
##  $ Agency                        : Factor w/ 3 levels "Central Pollution Control Board",..: 1 1 1 1 1 1 1 1 1 1 ...
##  $ Type.of.Location              : Factor w/ 3 levels "Industrial Area",..: 2 2 2 2 2 2 2 2 2 2 ...
##  $ SO2                           : int  4 4 4 4 4 4 4 4 4 4 ...
##  $ NO2                           : int  44 45 47 43 39 46 41 50 48 45 ...
##  $ RSPM.PM10                     : int  203 214 182 204 192 159 267 235 241 280 ...
##  $ PM.2.5                        : int  NA NA NA 78 83 146 62 112 62 NA ...
##  $ NO2_limit                     : num  80 80 80 80 80 80 80 80 80 80 ...

Labeling of the Data

We have labeled the “Central Pollution Control Board”, “Gujarat State Pollution Control Board”, “National Environmental Engineering Research Institute” in the data set to “Central”, “State”, “National” in the “Agency” column

RSPM$Agency <- factor(RSPM$Agency, levels = c("Central Pollution Control Board", "Gujarat State Pollution Control Board", "National Environmental Engineering Research Institute"), labels = c("Central", "State", "National"))
head(RSPM$Agency)
## [1] Central Central Central Central Central Central
## Levels: Central State National

Tidy Data

By seeing the data we can say that the data taken has all the required conditions to conclude tat it is tidy

head(RSPM)
##   Stn.Code Sampling.Date State City.Town.Village.Area
## 1       55     5/01/2015 Delhi                  Delhi
## 2       55     8/01/2015 Delhi                  Delhi
## 3       55    13/01/2015 Delhi                  Delhi
## 4       55    16/01/2015 Delhi                  Delhi
## 5       55    21/01/2015 Delhi                  Delhi
## 6       55    27/01/2015 Delhi                  Delhi
##   Location.of.Monitoring.Station  Agency
## 1              Nizamuddin, Delhi Central
## 2              Nizamuddin, Delhi Central
## 3              Nizamuddin, Delhi Central
## 4              Nizamuddin, Delhi Central
## 5              Nizamuddin, Delhi Central
## 6              Nizamuddin, Delhi Central
##                     Type.of.Location SO2 NO2 RSPM.PM10 PM.2.5 NO2_limit
## 1 Residential, Rural and other Areas   4  44       203     NA        80
## 2 Residential, Rural and other Areas   4  45       214     NA        80
## 3 Residential, Rural and other Areas   4  47       182     NA        80
## 4 Residential, Rural and other Areas   4  43       204     78        80
## 5 Residential, Rural and other Areas   4  39       192     83        80
## 6 Residential, Rural and other Areas   4  46       159    146        80

SCAN 1 NA Values

We are checking the missing values in the data for the columns “SO2”, “NO2”, “RSPM.PM10”, “PM 2.5” and assign them with the mean of the respected column

which(is.na(RSPM$SO2))
##  [1]   78   84  126  127  128  129  130  137  146  156  232  349  364 1177
which(is.na(RSPM$SO2))
##  [1]   78   84  126  127  128  129  130  137  146  156  232  349  364 1177
which(is.na(RSPM$RSPM.PM10))
##  [1]   84  126  127  128  129  130  137  146  232  349  364 1177
which(is.na(RSPM$`PM.2.5`))
##   [1]    1    2    3   10   72   73   74   75   76   77   78  121  150  151
##  [15]  152  153  154  155  156  162  163  181  190  194  197  198  199  200
##  [29]  201  202  203  204  205  206  207  208  209  210  211  212  213  214
##  [43]  215  216  217  218  219  220  227  228  229  230  231  232  233  260
##  [57]  262  265  268  305  306  307  308  309  310  311  312  317  324  335
##  [71]  347  350  366  380  381  382  383  384  385  386  387  388  389  390
##  [85]  391  392  393  394  395  396  397  398  399  400  401  402  403  404
##  [99]  405  406  407  408  409  410  411  412  413  414  415  416  417  418
## [113]  419  420  421  422  423  424  425  426  427  428  429  430  431  432
## [127]  433  434  435  436  437  438  439  440  441  442  443  444  445  446
## [141]  447  448  449  450  451  452  453  454  455  456  457  458  459  460
## [155]  461  462  463  464  465  466  467  468  469  470  471  472  473  474
## [169]  475  476  477  478  479  480  481  482  483  484  485  486  487  488
## [183]  489  490  491  492  493  494  495  496  497  498  499  500  501  502
## [197]  503  504  505  506  507  508  509  510  511  512  513  514  515  516
## [211]  517  518  519  520  521  522  523  524  525  526  527  528  529  530
## [225]  531  532  533  534  535  536  537  538  539  540  541  542  543  544
## [239]  545  546  547  548  549  550  551  552  553  554  555  556  557  558
## [253]  559  560  561  562  563  564  565  566  567  568  569  570  571  572
## [267]  573  574  575  576  577  578  579  580  581  582  583  584  585  586
## [281]  587  588  589  590  591  592  593  594  595  596  597  598  599  600
## [295]  601  602  603  604  605  606  607  608  609  610  611  612  613  614
## [309]  615  616  617  618  619  620  621  622  623  624  625  626  627  628
## [323]  629  630  631  632  633  634  635  636  637  638  639  640  641  642
## [337]  643  644  645  646  647  648  649  650  651  652  653  654  655  656
## [351]  657  658  659  660  661  662  663  664  665  666  670  676  680  690
## [365]  724  737  738  739  740  741  742  743  744 1177
RSPM$SO2[is.na(RSPM$SO2)] <- mean(RSPM$SO2, na.rm = TRUE)
which(is.na(RSPM$SO2))
## integer(0)
RSPM$NO2[is.na(RSPM$NO2)] <- mean(RSPM$NO2, na.rm = TRUE)
which(is.na(RSPM$SO2))
## integer(0)
RSPM$RSPM.PM10[is.na(RSPM$RSPM.PM10)]<- mean(RSPM$RSPM.PM10, na.rm= TRUE)
which(is.na(RSPM$RSPM.PM10))
## integer(0)
RSPM$PM.2.5[is.na(RSPM$`PM.2.5`)] <- mean(RSPM$`PM.2.5`, na.rm = TRUE)
which(is.na(RSPM$`PM.2.5`))
## integer(0)

MUTATE

We are mutating a new column named “Difference” by minusing the surveyed level of NO2 in air with the limited number being 80 for Delhi and with the limited number being 30 for Gujarat

The difference column shows the level of increase or decrease in the level of the NO2 in the air of Delhi and Gujarat

RSPM<-mutate(RSPM, Difference =  NO2_limit  - NO2)
head(RSPM)
##   Stn.Code Sampling.Date State City.Town.Village.Area
## 1       55     5/01/2015 Delhi                  Delhi
## 2       55     8/01/2015 Delhi                  Delhi
## 3       55    13/01/2015 Delhi                  Delhi
## 4       55    16/01/2015 Delhi                  Delhi
## 5       55    21/01/2015 Delhi                  Delhi
## 6       55    27/01/2015 Delhi                  Delhi
##   Location.of.Monitoring.Station  Agency
## 1              Nizamuddin, Delhi Central
## 2              Nizamuddin, Delhi Central
## 3              Nizamuddin, Delhi Central
## 4              Nizamuddin, Delhi Central
## 5              Nizamuddin, Delhi Central
## 6              Nizamuddin, Delhi Central
##                     Type.of.Location SO2 NO2 RSPM.PM10    PM.2.5 NO2_limit
## 1 Residential, Rural and other Areas   4  44       203  47.43143        80
## 2 Residential, Rural and other Areas   4  45       214  47.43143        80
## 3 Residential, Rural and other Areas   4  47       182  47.43143        80
## 4 Residential, Rural and other Areas   4  43       204  78.00000        80
## 5 Residential, Rural and other Areas   4  39       192  83.00000        80
## 6 Residential, Rural and other Areas   4  46       159 146.00000        80
##   Difference
## 1         36
## 2         35
## 3         33
## 4         37
## 5         41
## 6         34

SCAN 2 OUTLIERS

We are using the Z-score (i.e.,normal score )method to detect the outliers in the data frame.A standardised score (z-score) of all observations are calculated using the following equation:

z.scores=RSPM$SO2 %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.4714 -1.1387  0.3584  0.0000  0.5248  5.8479
which(abs(z.scores)>3)
##  [1]  465  556  557  562  563  600  651  655  657 1208
RSPM_SO2<- (-which(abs(z.scores)>3))
z.scores=RSPM_SO2 %>% scores(type = "z")
z.scores %>% summary()
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -2.72503 -0.03208  0.32033  0.00000  0.43335  0.88663

we can see that the min value was -1.4714 and max value was 5.8479

we use the which(abs(z.scores)>3) to see the location of outliers

which was minimised to the max value 0.88663 and min value -2.72503

z.scores=RSPM$NO2 %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -0.8683 -0.6172 -0.5544  0.0000  0.2931  5.7861
which(abs(z.scores)>3)
##  [1] 406 467 468 472 476 477 478 479 487 488 494 497 499 504 505 506 507
## [18] 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 571 589
## [35] 651 652 654 655 656 659 660 661 662 665 666
RSPM_NO2<- (-which(abs(z.scores)>3))
z.scores=RSPM_NO2 %>% scores(type = "z")
z.scores %>% summary()
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -1.55799 -0.46275 -0.05026  0.00000  0.84585  2.14023

we can see that the min value was -0.8683 and max value was 5.7861

we use the which(abs(z.scores)>3) to see the location of outliers

which was minimised to the min value -1.55799 and max value 2.14023

z.scores=RSPM$`RSPM.PM10` %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.3164 -0.6167 -0.5090  0.0000  0.3953  8.0928
which(abs(z.scores)>3)
##  [1]  74 145 154 158 188 226 228 305 306 308 381 504 556 564 603 606 608
## [18] 651 654 655 661 662 665 666 728 730 733 736 737 744
RSPM_RSPM10<- (-which(abs(z.scores)>3))
z.scores=RSPM_RSPM10 %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.0947 -0.7400 -0.4743  0.0000  0.8567  1.8852

we can see that the min value was -1.3164 and max value was 8.0928

we use the which(abs(z.scores)>3) to see the location of outliers

which was minimised to the min value -1.0947 and max value 1.8852

z.scores=RSPM$`PM.2.5` %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.1656 -0.5287 -0.3467  0.0000  0.0000  8.2059
which(abs(z.scores)>3)
##  [1]  63  64  67  70  80  81  86  88  89  91 141 143 144 146 147 148 149
## [18] 157 158 159 165 166 221 222 223 226 287 296 298 300 315 316 378 673
## [35] 674 677 698 718 720 723 725 728 730 732 733 734 735
RSPM_PM2.5<- (-which(abs(z.scores)>3))
z.scores=RSPM_PM2.5 %>% scores(type = "z")
z.scores %>% summary()
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
## -1.5346 -1.3071  0.4272  0.0000  0.7274  1.0352

we can see that the min value was -1.1656 and max value was 8.2059

we use the which(abs(z.scores)>3) to see the location of outliers

which was minimised to the min value -1.5346 and max value 1.0352

z.scores=RSPM$Difference %>% scores(type = "z")
z.scores %>% summary()
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -6.86758 -0.12079 -0.03202  0.00000  0.45624  2.27610
which(abs(z.scores)>3)
##  [1] 406 467 468 472 476 477 478 479 487 488 494 497 504 505 506 507 555
## [18] 556 557 558 559 560 561 562 563 564 565 566 568 569 571 589 651 652
## [35] 654 655 656 659 661 662 665 666
RSPM_Difference<- (-which(abs(z.scores)>3))
z.scores=RSPM_Difference %>% scores(type = "z")
z.scores %>% summary()
##     Min.  1st Qu.   Median     Mean  3rd Qu.     Max. 
## -1.57476 -0.41728 -0.06222  0.00000  0.85738  2.11783

we can see that the min value was -6.86758 and max value was 2.27610

we use the which(abs(z.scores)>3) to see the location of outliers

which was minimised to the min value -1.57476 and max value 2.11783

Data Transformation

we are using the PM 2.5 column to decrease the skewness

histogram(RSPM$`PM.2.5`)

The above histogram shows that it is skewed towards right

skewness(RSPM$`PM.2.5`)
## [1] 3.092601

The skewness of the column PM.2.5 is 3.092601

We use the BoxCox function to decrease the skewness of the column PM 2.5

BoxCox_PM2.5<-BoxCox(RSPM$`PM.2.5`,lambda="auto")
BoxCox_PM2.5
##    [1] 1.591312 1.591312 1.591312 1.642467 1.647922 1.689761 1.620602
##    [8] 1.671744 1.620602 1.591312 1.622218 1.668364 1.611871 1.582289
##   [15] 1.590234 1.638926 1.590234 1.642467 1.646873 1.642467 1.633847
##   [22] 1.613711 1.641311 1.603981 1.524751 1.653829 1.655663 1.660807
##   [29] 1.618945 1.663969 1.641311 1.641311 1.680077 1.640131 1.608037
##   [36] 1.576507 1.671744 1.663197 1.646873 1.656556 1.649963 1.647922
##   [43] 1.576507 1.620602 1.650956 1.626835 1.601862 1.556249 1.582289
##   [50] 1.539560 1.613711 1.625333 1.651931 1.519274 1.642467 1.670421
##   [57] 1.633847 1.622218 1.599679 1.662413 1.661616 1.640131 1.693077
##   [64] 1.694637 1.671087 1.673662 1.696502 1.609981 1.680617 1.695767
##   [71] 1.677848 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##   [78] 1.591312 1.670421 1.693473 1.696502 1.688888 1.684711 1.677273
##   [85] 1.663969 1.697223 1.673662 1.698969 1.691866 1.686150 1.693077
##   [92] 1.680077 1.677848 1.623794 1.649963 1.657435 1.633847 1.640131
##   [99] 1.662413 1.654754 1.648952 1.673662 1.563552 1.676101 1.637697
##  [106] 1.585028 1.640131 1.592709 1.595106 1.519274 1.666943 1.609981
##  [113] 1.566984 1.622218 1.640131 1.629736 1.566984 1.440362 1.585028
##  [120] 1.486515 1.591312 1.539560 1.440362 1.386059 1.599679 1.597428
##  [127] 1.606038 1.524751 1.524751 1.534872 1.548286 1.579450 1.566984
##  [134] 1.638926 1.645803 1.451088 1.662413 1.667659 1.649963 1.635158
##  [141] 1.729646 1.687995 1.695767 1.696136 1.678416 1.727220 1.690616
##  [148] 1.718150 1.709533 1.591312 1.591312 1.591312 1.591312 1.591312
##  [155] 1.591312 1.591312 1.691866 1.690191 1.692274 1.686619 1.662413
##  [162] 1.591312 1.591312 1.642467 1.699645 1.693473 1.668364 1.686150
##  [169] 1.623794 1.608037 1.631137 1.576507 1.620602 1.661616 1.585028
##  [176] 1.592709 1.623794 1.601862 1.587675 1.658298 1.591312 1.660807
##  [183] 1.606038 1.659148 1.674284 1.681677 1.645803 1.582289 1.642467
##  [190] 1.591312 1.657435 1.663197 1.650956 1.591312 1.585028 1.606038
##  [197] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [204] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [211] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [218] 1.591312 1.591312 1.591312 1.712899 1.721786 1.721268 1.688888
##  [225] 1.688444 1.710530 1.591312 1.591312 1.591312 1.591312 1.591312
##  [232] 1.591312 1.591312 1.620602 1.618945 1.609981 1.648952 1.669745
##  [239] 1.689327 1.632507 1.646873 1.684220 1.643601 1.618945 1.673032
##  [246] 1.670421 1.601862 1.659984 1.659984 1.671087 1.644713 1.680617
##  [253] 1.653829 1.635158 1.625333 1.629736 1.566984 1.597428 1.592709
##  [260] 1.591312 1.674898 1.591312 1.613711 1.620602 1.591312 1.675503
##  [267] 1.615501 1.591312 1.671087 1.661616 1.637697 1.658298 1.609981
##  [274] 1.686619 1.628302 1.657435 1.644713 1.579450 1.657435 1.665478
##  [281] 1.629736 1.643601 1.687995 1.620602 1.674898 1.654754 1.690616
##  [288] 1.645803 1.651931 1.676691 1.640131 1.650956 1.615501 1.601862
##  [295] 1.632507 1.712439 1.658298 1.713352 1.648952 1.706352 1.631137
##  [302] 1.653829 1.678416 1.659984 1.591312 1.591312 1.591312 1.591312
##  [309] 1.591312 1.591312 1.591312 1.591312 1.650956 1.680077 1.693865
##  [316] 1.699645 1.591312 1.620602 1.632507 1.679530 1.615501 1.648952
##  [323] 1.661616 1.591312 1.670421 1.676101 1.660807 1.663197 1.657435
##  [330] 1.618945 1.595106 1.609981 1.638926 1.617246 1.591312 1.647922
##  [337] 1.636441 1.513483 1.644713 1.587675 1.660807 1.519274 1.657435
##  [344] 1.680077 1.676101 1.548286 1.591312 1.563552 1.628302 1.591312
##  [351] 1.664730 1.638926 1.582289 1.682712 1.653829 1.618945 1.651931
##  [358] 1.659148 1.620602 1.648952 1.633847 1.637697 1.657435 1.644713
##  [365] 1.651931 1.591312 1.658298 1.623794 1.613711 1.651931 1.644713
##  [372] 1.670421 1.651931 1.663969 1.679530 1.684711 1.673662 1.716359
##  [379] 1.680077 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [386] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [393] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [400] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [407] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [414] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [421] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [428] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [435] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [442] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [449] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [456] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [463] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [470] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [477] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [484] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [491] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [498] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [505] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [512] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [519] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [526] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [533] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [540] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [547] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [554] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [561] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [568] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [575] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [582] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [589] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [596] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [603] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [610] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [617] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [624] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [631] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [638] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [645] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [652] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [659] 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [666] 1.591312 1.687541 1.686619 1.677273 1.591312 1.680617 1.681677
##  [673] 1.703458 1.701282 1.676691 1.591312 1.691454 1.686150 1.657435
##  [680] 1.591312 1.664730 1.636441 1.631137 1.617246 1.645803 1.649963
##  [687] 1.640131 1.652888 1.623794 1.591312 1.653829 1.674284 1.609981
##  [694] 1.633847 1.650956 1.669060 1.638926 1.693865 1.658298 1.659148
##  [701] 1.652888 1.623794 1.687083 1.669060 1.628302 1.576507 1.658298
##  [708] 1.582289 1.656556 1.678976 1.599679 1.611871 1.674898 1.599679
##  [715] 1.673662 1.576507 1.563552 1.691454 1.673032 1.698626 1.684711
##  [722] 1.606038 1.699645 1.591312 1.691866 1.686150 1.666216 1.701917
##  [729] 1.685196 1.714021 1.674898 1.707176 1.705792 1.717367 1.704056
##  [736] 1.674284 1.591312 1.591312 1.591312 1.591312 1.591312 1.591312
##  [743] 1.591312 1.591312 1.519274 1.500838 1.539560 1.529943 1.513483
##  [750] 1.539560 1.524751 1.507350 1.529943 1.507350 1.519274 1.544026
##  [757] 1.500838 1.519274 1.534872 1.507350 1.519274 1.500838 1.544026
##  [764] 1.556249 1.529943 1.539560 1.544026 1.513483 1.544026 1.534872
##  [771] 1.552356 1.563552 1.529943 1.539560 1.519274 1.548286 1.552356
##  [778] 1.524751 1.544026 1.534872 1.559978 1.513483 1.529943 1.539560
##  [785] 1.548286 1.524751 1.539560 1.552356 1.544026 1.519274 1.573454
##  [792] 1.529943 1.544026 1.519274 1.534872 1.507350 1.519274 1.529943
##  [799] 1.539560 1.493908 1.534872 1.513483 1.524751 1.513483 1.544026
##  [806] 1.529943 1.552356 1.519274 1.548286 1.529943 1.507350 1.559978
##  [813] 1.534872 1.539560 1.539560 1.529943 1.493908 1.534872 1.524751
##  [820] 1.544026 1.507350 1.534872 1.500838 1.513483 1.507350 1.524751
##  [827] 1.544026 1.534872 1.524751 1.513483 1.500838 1.529943 1.534872
##  [834] 1.513483 1.524751 1.552356 1.507350 1.529943 1.544026 1.524751
##  [841] 1.524751 1.500838 1.529943 1.513483 1.507350 1.534872 1.500838
##  [848] 1.486515 1.519274 1.507350 1.539560 1.493908 1.519274 1.529943
##  [855] 1.493908 1.513483 1.470114 1.486515 1.524751 1.539560 1.513483
##  [862] 1.493908 1.500838 1.478604 1.486515 1.519274 1.548286 1.552356
##  [869] 1.544026 1.552356 1.529943 1.534872 1.519274 1.524751 1.539560
##  [876] 1.529943 1.539560 1.529943 1.573454 1.524751 1.539560 1.534872
##  [883] 1.519274 1.556249 1.539560 1.507350 1.548286 1.534872 1.544026
##  [890] 1.524751 1.544026 1.529943 1.539560 1.576507 1.563552 1.507350
##  [897] 1.534872 1.534872 1.556249 1.513483 1.539560 1.556249 1.579450
##  [904] 1.559978 1.544026 1.440362 1.401728 1.348807 1.386059 1.326330
##  [911] 1.270167 1.524751 1.548286 1.507350 1.529943 1.544026 1.534872
##  [918] 1.500838 1.534872 1.539560 1.529943 1.556249 1.519274 1.559978
##  [925] 1.534872 1.507350 1.524751 1.552356 1.539560 1.570282 1.544026
##  [932] 1.552356 1.519274 1.556249 1.544026 1.270167 1.470114 1.326330
##  [939] 1.451088 1.534872 1.428667 1.493908 1.513483 1.524751 1.478604
##  [946] 1.493908 1.507350 1.534872 1.519274 1.500838 1.519274 1.529943
##  [953] 1.507350 1.493908 1.534872 1.524751 1.534872 1.507350 1.534872
##  [960] 1.524751 1.486515 1.539560 1.519274 1.513483 1.524751 1.348807
##  [967] 1.368547 1.386059 1.348807 1.440362 1.401728 1.428667 1.507350
##  [974] 1.524751 1.493908 1.534872 1.524751 1.486515 1.519274 1.529943
##  [981] 1.513483 1.500838 1.534872 1.544026 1.556249 1.519274 1.529943
##  [988] 1.524751 1.534872 1.552356 1.493908 1.513483 1.548286 1.524751
##  [995] 1.544026 1.507350 1.507350 1.493908 1.529943 1.552356 1.486515
## [1002] 1.507350 1.478604 1.507350 1.513483 1.500838 1.534872 1.529943
## [1009] 1.544026 1.524751 1.552356 1.500838 1.500838 1.519274 1.529943
## [1016] 1.539560 1.524751 1.556249 1.539560 1.513483 1.486515 1.529943
## [1023] 1.348807 1.507350 1.386059 1.529943 1.507350 1.529943 1.539560
## [1030] 1.524751 1.513483 1.493908 1.534872 1.529943 1.529943 1.513483
## [1037] 1.539560 1.552356 1.519274 1.486515 1.534872 1.548286 1.539560
## [1044] 1.519274 1.544026 1.534872 1.500838 1.556249 1.529943 1.534872
## [1051] 1.524751 1.513483 1.500838 1.544026 1.529943 1.524751 1.493908
## [1058] 1.534872 1.524751 1.548286 1.513483 1.519274 1.539560 1.534872
## [1065] 1.524751 1.544026 1.513483 1.544026 1.500838 1.556249 1.548286
## [1072] 1.529943 1.539560 1.529943 1.507350 1.524751 1.539560 1.519274
## [1079] 1.544026 1.513483 1.539560 1.529943 1.513483 1.544026 1.500838
## [1086] 1.519274 1.556249 1.513483 1.524751 1.529943 1.524751 1.544026
## [1093] 1.519274 1.556249 1.534872 1.539560 1.513483 1.544026 1.539560
## [1100] 1.524751 1.556249 1.544026 1.507350 1.570282 1.519274 1.529943
## [1107] 1.529943 1.552356 1.573454 1.524751 1.534872 1.563552 1.507350
## [1114] 1.524751 1.539560 1.524751 1.552356 1.563552 1.582289 1.513483
## [1121] 1.548286 1.529943 1.544026 1.513483 1.529943 1.534872 1.507350
## [1128] 1.552356 1.493908 1.507350 1.519274 1.529943 1.539560 1.507350
## [1135] 1.486515 1.513483 1.534872 1.513483 1.513483 1.534872 1.519274
## [1142] 1.552356 1.513483 1.539560 1.544026 1.500838 1.539560 1.524751
## [1149] 1.552356 1.529943 1.556249 1.534872 1.507350 1.524751 1.539560
## [1156] 1.529943 1.552356 1.534872 1.507350 1.548286 1.524751 1.529943
## [1163] 1.544026 1.559978 1.548286 1.529943 1.529943 1.552356 1.534872
## [1170] 1.519274 1.539560 1.524751 1.548286 1.507350 1.519274 1.534872
## [1177] 1.591312 1.524751 1.513483 1.529943 1.539560 1.519274 1.524751
## [1184] 1.556249 1.539560 1.534872 1.519274 1.552356 1.548286 1.534872
## [1191] 1.524751 1.539560 1.544026 1.563552 1.566984 1.534872 1.529943
## [1198] 1.548286 1.544026 1.552356 1.534872 1.556249 1.552356 1.524751
## [1205] 1.548286 1.524751 1.544026 1.592709 1.548286 1.529943 1.539560
## [1212] 1.519274 1.566984 1.544026 1.529943 1.576507 1.563552 1.552356
## [1219] 1.524751 1.563552 1.544026 1.548286 1.566984 1.519274 1.556249
## [1226] 1.548286 1.539560 1.559978 1.570282 1.552356 1.559978 1.539560
## [1233] 1.556249 1.544026 1.539560 1.570282 1.556249 1.552356 1.579450
## [1240] 1.529943 1.548286 1.539560 1.556249 1.576507 1.559978 1.548286
## [1247] 1.519274 1.563552 1.570282 1.552356 1.548286 1.563552 1.570282
## [1254] 1.585028 1.563552 1.548286 1.539560 1.529943 1.556249 1.539560
## [1261] 1.576507 1.529943 1.548286 1.582289 1.556249 1.570282 1.552356
## [1268] 1.559978 1.544026 1.563552 1.585028 1.556249 1.559978 1.493908
## [1275] 1.513483 1.500838 1.539560 1.524751 1.544026 1.507350 1.529943
## [1282] 1.507350 1.524751 1.500838 1.534872 1.544026 1.534872 1.513483
## [1289] 1.529943 1.519274 1.534872 1.493908 1.524751 1.534872 1.552356
## [1296] 1.529943 1.548286 1.451088 1.470114 1.428667 1.486515 1.368547
## [1303] 1.470114 1.386059 1.534872 1.524751 1.513483 1.552356 1.563552
## [1310] 1.507350 1.544026 1.529943 1.544026 1.519274 1.556249 1.524751
## [1317] 1.548286 1.500838 1.524751 1.507350 1.552356 1.524751 1.544026
## [1324] 1.534872 1.548286 1.556249 1.507350 1.519274 1.500838 1.486515
## [1331] 1.524751 1.493908 1.548286 1.513483 1.529943 1.493908 1.529943
## [1338] 1.500838 1.534872 1.544026 1.524751 1.500838 1.529943 1.513483
## [1345] 1.524751 1.486515 1.544026 1.556249 1.513483 1.548286 1.513483
## [1352] 1.493908 1.552356 1.539560 1.519274 1.529943 1.539560 1.507350
## [1359] 1.544026 1.513483 1.544026 1.529943 1.552356 1.544026 1.519274
## [1366] 1.534872 1.552356 1.524751 1.548286 1.552356 1.529943 1.539560
## [1373] 1.556249 1.529943 1.566984 1.534872 1.552356 1.579450 1.548286
## [1380] 1.556249 1.566984 1.544026 1.563552 1.548286 1.559978 1.548286
## [1387] 1.570282 1.552356 1.563552 1.539560 1.566984 1.552356 1.566984
## [1394] 1.552356 1.582289 1.548286 1.566984 1.544026 1.556249 1.552356
## [1401] 1.415852 1.486515 1.386059 1.451088 1.386059 1.440362 1.563552
## [1408] 1.548286 1.529943 1.552356 1.559978 1.573454 1.544026 1.559978
## [1415] 1.563552 1.563552 1.539560 1.556249 1.563552 1.563552 1.539560
## [1422] 1.556249 1.552356 1.573454 1.529943 1.566984 1.556249 1.559978
## [1429] 1.539560 1.556249 1.563552 1.539560 1.529943 1.559978 1.570282
## [1436] 1.519274 1.556249 1.539560 1.544026 1.563552 1.559978 1.576507
## [1443] 1.563552 1.534872 1.524751 1.552356 1.552356 1.556249 1.563552
## [1450] 1.552356 1.570282 1.556249 1.556249 1.548286 1.559978 1.563552
## [1457] 1.552356 1.570282 1.539560 1.559978 1.573454 1.556249 1.552356
## [1464] 1.563552 1.552356 1.539560 1.585028 1.563552 1.529943 1.559978
## [1471] 1.544026 1.524751 1.534872 1.513483 1.529943 1.534872 1.513483
## [1478] 1.534872 1.507350 1.544026 1.519274 1.529943 1.513483 1.539560
## [1485] 1.519274 1.544026 1.513483 1.556249 1.519274 1.534872 1.539560
## [1492] 1.529943 1.513483 1.507350 1.519274 1.524751 1.519274 1.529943
## [1499] 1.534872 1.524751 1.519274 1.548286 1.539560 1.529943 1.507350
## [1506] 1.529943 1.534872 1.524751 1.529943 1.529943 1.539560 1.524751
## [1513] 1.529943 1.548286 1.534872 1.519274 1.507350 1.524751 1.539560
## [1520] 1.524751 1.548286 1.556249 1.563552 1.552356 1.544026 1.559978
## [1527] 1.563552 1.570282 1.539560 1.544026 1.539560 1.556249 1.529943
## [1534] 1.548286 1.563552 1.556249 1.566984 1.548286 1.573454 1.544026
## [1541] 1.534872 1.570282 1.552356 1.544026 1.563552 1.556249 1.539560
## [1548] 1.570282 1.576507 1.544026 1.552356 1.534872 1.507350 1.524751
## [1555] 1.500838 1.519274 1.539560 1.556249 1.513483 1.519274 1.524751
## [1562] 1.539560 1.529943 1.519274 1.500838 1.544026 1.507350 1.548286
## [1569] 1.529943 1.507350 1.548286 1.534872 1.507350 1.529943 1.519274
## [1576] 1.544026 1.539560 1.524751 1.548286 1.534872 1.548286 1.556249
## [1583] 1.529943 1.548286 1.529943 1.552356 1.548286 1.524751 1.534872
## [1590] 1.556249 1.519274 1.548286 1.534872 1.552356 1.539560 1.570282
## [1597] 1.556249 1.524751 1.548286 1.529943 1.548286 1.548286 1.559978
## [1604] 1.573454 1.539560 1.552356 1.556249 1.563552 1.559978 1.552356
## [1611] 1.539560 1.563552 1.552356 1.576507 1.548286 1.539560 1.544026
## [1618] 1.556249 1.544026 1.552356 1.566984 1.559978 1.576507 1.570282
## [1625] 1.563552 1.556249 1.548286 1.529943 1.539560 1.548286 1.556249
## [1632] 1.570282 1.563552 1.548286 1.539560 1.556249 1.507350 1.534872
## [1639] 1.478604 1.552356 1.519274 1.507350 1.529943 1.513483 1.513483
## [1646] 1.548286 1.524751 1.507350 1.534872 1.500838 1.519274 1.556249
## [1653] 1.529943 1.507350 1.524751 1.544026 1.500838 1.559978 1.539560
## [1660] 1.524751 1.544026 1.519274 1.507350 1.529943 1.500838 1.524751
## [1667] 1.539560 1.534872 1.524751 1.500838 1.544026 1.507350 1.529943
## [1674] 1.539560 1.524751 1.507350 1.534872 1.507350 1.539560 1.524751
## [1681] 1.529943 1.544026 1.534872 1.519274 1.513483 1.529943 1.507350
## [1688] 1.524751 1.539560 1.486515 1.556249 1.534872 1.529943 1.519274
## [1695] 1.534872 1.556249 1.544026 1.513483 1.534872 1.507350 1.519274
## [1702] 1.539560 1.529943 1.539560 1.552356 1.513483 1.559978 1.529943
## [1709] 1.524751 1.493908 1.544026 1.513483 1.556249 1.539560 1.493908
## [1716] 1.534872 1.544026 1.519274 1.524751 1.507350 1.539560 1.552356
## [1723] 1.513483 1.529943 1.548286 1.507350 1.544026 1.552356 1.529943
## [1730] 1.539560 1.513483 1.534872 1.534872 1.566984 1.539560 1.570282
## [1737] 1.519274 1.548286 1.524751 1.556249 1.529943 1.559978 1.570282
## [1744] 1.548286 1.544026 1.552356 1.539560 1.559978 1.573454 1.556249
## [1751] 1.559978 1.544026 1.529943 1.556249 1.548286 1.524751 1.556249
## [1758] 1.548286 1.539560 1.529943 1.519274 1.534872 1.539560 1.529943
## [1765] 1.539560 1.548286 1.524751 1.556249 1.534872 1.529943 1.539560
## [1772] 1.556249 1.534872 1.566984 1.544026 1.529943 1.556249 1.548286
## [1779] 1.563552 1.513483 1.486515 1.524751 1.544026 1.529943 1.507350
## [1786] 1.548286 1.556249 1.544026 1.500838 1.566984 1.556249 1.524751
## [1793] 1.534872 1.539560 1.570282 1.552356 1.534872 1.507350 1.559978
## [1800] 1.539560 1.548286 1.548286 1.556249 1.524751 1.534872 1.500838
## [1807] 1.529943 1.544026 1.524751 1.529943 1.544026 1.552356 1.539560
## [1814] 1.507350 1.534872 1.559978 1.519274 1.544026 1.519274 1.534872
## [1821] 1.552356 1.539560 1.529943 1.548286 1.534872
## attr(,"lambda")
## [1] -0.5544645
histogram(BoxCox_PM2.5)

By the above histogram we can see that the plot has decreased the skewness to a large extent even though there is a little skewness the histogram has improved

skewness(BoxCox_PM2.5)
## [1] 0.1010622

The skewness of the column PM.2.5 was 3.092601 has improved after using the function BoxCox which has decreased to 0.1010622

————————————————————————-END———————————————————–