Question 2: Is there a significant difference in ozone concentration between years (2003, 2013, 2023)? If so, what is possibly driving that difference. Note, for this analysis, you should conduct three separate comparisons: 1) 2003 & 2013, 2) 2013 & 2023, 3) 2003 & 2023. Provide a 250-500 word summary of your analysis interpretation of your results. Please cite all outside references (e.g., papers, government reports) used to support your interpretation.

#import dataset
ozone_2023 <- read.csv("C:/Users/noahs/Downloads/2023_ozone.csv", header = T)
ozone_2013 <- read.csv("C:/Users/noahs/Downloads/2013_ozone.csv", header = T)
ozone_2003 <- read.csv("C:/Users/noahs/Downloads/2003_ozone.csv", header = T)
#treat 2003, 2013, and 2013 as categorical groups.
#we are testing if any one of these groups is different 
#Ho: Average ozone concentrations are the same in 2003, 2013, and 2023.
#HA: At least one year has a different average ozone (or dissolved oxygen) concentration.
#we will run ANOVA tests, but first we we need to see that it meets the assumptions of ANOVA

O2_2023 <- ozone_2023$Daily.Max.8.hour.Ozone.Concentration
O2_2013 <- ozone_2013$Daily.Max.8.hour.Ozone.Concentration
O2_2003 <- ozone_2003$Daily.Max.8.hour.Ozone.Concentration

O2_data <- data.frame(
  Year = c(
    rep("2023", length(O2_2023)),
    rep("2013", length(O2_2013)),
    rep("2003", length(O2_2003))
  ),
  O2 = c(O2_2023, O2_2013, O2_2003)
)

print(O2_data)
##      Year    O2
## 1    2023 0.033
## 2    2023 0.034
## 3    2023 0.032
## 4    2023 0.039
## 5    2023 0.034
## 6    2023 0.030
## 7    2023 0.039
## 8    2023 0.038
## 9    2023 0.032
## 10   2023 0.038
## 11   2023 0.034
## 12   2023 0.030
## 13   2023 0.032
## 14   2023 0.035
## 15   2023 0.037
## 16   2023 0.034
## 17   2023 0.025
## 18   2023 0.026
## 19   2023 0.031
## 20   2023 0.026
## 21   2023 0.029
## 22   2023 0.032
## 23   2023 0.030
## 24   2023 0.030
## 25   2023 0.028
## 26   2023 0.035
## 27   2023 0.036
## 28   2023 0.035
## 29   2023 0.031
## 30   2023 0.029
## 31   2023 0.026
## 32   2023 0.030
## 33   2023 0.025
## 34   2023 0.025
## 35   2023 0.033
## 36   2023 0.037
## 37   2023 0.029
## 38   2023 0.032
## 39   2023 0.030
## 40   2023 0.039
## 41   2023 0.040
## 42   2023 0.039
## 43   2023 0.035
## 44   2023 0.039
## 45   2023 0.036
## 46   2023 0.031
## 47   2023 0.027
## 48   2023 0.034
## 49   2023 0.039
## 50   2023 0.043
## 51   2023 0.043
## 52   2023 0.042
## 53   2023 0.038
## 54   2023 0.037
## 55   2023 0.039
## 56   2023 0.036
## 57   2023 0.034
## 58   2023 0.036
## 59   2023 0.039
## 60   2023 0.036
## 61   2023 0.039
## 62   2023 0.043
## 63   2023 0.043
## 64   2023 0.042
## 65   2023 0.041
## 66   2023 0.031
## 67   2023 0.027
## 68   2023 0.032
## 69   2023 0.032
## 70   2023 0.032
## 71   2023 0.033
## 72   2023 0.041
## 73   2023 0.042
## 74   2023 0.040
## 75   2023 0.041
## 76   2023 0.038
## 77   2023 0.042
## 78   2023 0.042
## 79   2023 0.041
## 80   2023 0.044
## 81   2023 0.044
## 82   2023 0.044
## 83   2023 0.042
## 84   2023 0.039
## 85   2023 0.041
## 86   2023 0.042
## 87   2023 0.044
## 88   2023 0.047
## 89   2023 0.038
## 90   2023 0.040
## 91   2023 0.042
## 92   2023 0.043
## 93   2023 0.046
## 94   2023 0.036
## 95   2023 0.037
## 96   2023 0.048
## 97   2023 0.051
## 98   2023 0.039
## 99   2023 0.047
## 100  2023 0.048
## 101  2023 0.050
## 102  2023 0.050
## 103  2023 0.044
## 104  2023 0.047
## 105  2023 0.047
## 106  2023 0.049
## 107  2023 0.051
## 108  2023 0.050
## 109  2023 0.043
## 110  2023 0.038
## 111  2023 0.055
## 112  2023 0.057
## 113  2023 0.060
## 114  2023 0.066
## 115  2023 0.055
## 116  2023 0.044
## 117  2023 0.037
## 118  2023 0.035
## 119  2023 0.038
## 120  2023 0.037
## 121  2023 0.039
## 122  2023 0.038
## 123  2023 0.037
## 124  2023 0.045
## 125  2023 0.046
## 126  2023 0.050
## 127  2023 0.052
## 128  2023 0.056
## 129  2023 0.066
## 130  2023 0.066
## 131  2023 0.059
## 132  2023 0.060
## 133  2023 0.064
## 134  2023 0.055
## 135  2023 0.055
## 136  2023 0.047
## 137  2023 0.054
## 138  2023 0.061
## 139  2023 0.042
## 140  2023 0.042
## 141  2023 0.047
## 142  2023 0.055
## 143  2023 0.054
## 144  2023 0.038
## 145  2023 0.036
## 146  2023 0.048
## 147  2023 0.050
## 148  2023 0.057
## 149  2023 0.060
## 150  2023 0.066
## 151  2023 0.070
## 152  2023 0.050
## 153  2023 0.051
## 154  2023 0.047
## 155  2023 0.056
## 156  2023 0.057
## 157  2023 0.044
## 158  2023 0.049
## 159  2023 0.057
## 160  2023 0.056
## 161  2023 0.056
## 162  2023 0.055
## 163  2023 0.064
## 164  2023 0.065
## 165  2023 0.042
## 166  2023 0.044
## 167  2023 0.042
## 168  2023 0.051
## 169  2023 0.043
## 170  2023 0.047
## 171  2023 0.052
## 172  2023 0.047
## 173  2023 0.055
## 174  2023 0.055
## 175  2023 0.053
## 176  2023 0.073
## 177  2023 0.071
## 178  2023 0.070
## 179  2023 0.070
## 180  2023 0.064
## 181  2023 0.064
## 182  2023 0.059
## 183  2023 0.052
## 184  2023 0.046
## 185  2023 0.046
## 186  2023 0.061
## 187  2023 0.069
## 188  2023 0.070
## 189  2023 0.049
## 190  2023 0.065
## 191  2023 0.071
## 192  2023 0.077
## 193  2023 0.072
## 194  2023 0.068
## 195  2023 0.074
## 196  2023 0.075
## 197  2023 0.076
## 198  2023 0.069
## 199  2023 0.069
## 200  2023 0.053
## 201  2023 0.052
## 202  2023 0.061
## 203  2023 0.058
## 204  2023 0.060
## 205  2023 0.060
## 206  2023 0.058
## 207  2023 0.059
## 208  2023 0.065
## 209  2023 0.055
## 210  2023 0.053
## 211  2023 0.055
## 212  2023 0.056
## 213  2023 0.058
## 214  2023 0.058
## 215  2023 0.055
## 216  2023 0.059
## 217  2023 0.056
## 218  2023 0.046
## 219  2023 0.052
## 220  2023 0.045
## 221  2023 0.065
## 222  2023 0.075
## 223  2023 0.060
## 224  2023 0.064
## 225  2023 0.063
## 226  2023 0.057
## 227  2023 0.051
## 228  2023 0.042
## 229  2023 0.054
## 230  2023 0.064
## 231  2023 0.067
## 232  2023 0.056
## 233  2023 0.058
## 234  2023 0.055
## 235  2023 0.062
## 236  2023 0.053
## 237  2023 0.073
## 238  2023 0.072
## 239  2023 0.032
## 240  2023 0.039
## 241  2023 0.033
## 242  2023 0.043
## 243  2023 0.052
## 244  2023 0.060
## 245  2023 0.059
## 246  2023 0.060
## 247  2023 0.049
## 248  2023 0.052
## 249  2023 0.055
## 250  2023 0.056
## 251  2023 0.069
## 252  2023 0.056
## 253  2023 0.051
## 254  2023 0.049
## 255  2023 0.050
## 256  2023 0.051
## 257  2023 0.052
## 258  2023 0.053
## 259  2023 0.054
## 260  2023 0.060
## 261  2023 0.061
## 262  2023 0.047
## 263  2023 0.040
## 264  2023 0.047
## 265  2023 0.044
## 266  2023 0.043
## 267  2023 0.030
## 268  2023 0.036
## 269  2023 0.041
## 270  2023 0.047
## 271  2023 0.061
## 272  2023 0.062
## 273  2023 0.065
## 274  2023 0.070
## 275  2023 0.066
## 276  2023 0.035
## 277  2023 0.042
## 278  2023 0.038
## 279  2023 0.040
## 280  2023 0.042
## 281  2023 0.051
## 282  2023 0.052
## 283  2023 0.046
## 284  2023 0.045
## 285  2023 0.058
## 286  2023 0.071
## 287  2023 0.079
## 288  2023 0.043
## 289  2023 0.029
## 290  2023 0.034
## 291  2023 0.043
## 292  2023 0.042
## 293  2023 0.035
## 294  2023 0.041
## 295  2023 0.041
## 296  2023 0.044
## 297  2023 0.048
## 298  2023 0.046
## 299  2023 0.052
## 300  2023 0.060
## 301  2023 0.059
## 302  2023 0.060
## 303  2023 0.042
## 304  2023 0.036
## 305  2023 0.038
## 306  2023 0.033
## 307  2023 0.036
## 308  2023 0.034
## 309  2023 0.041
## 310  2023 0.049
## 311  2023 0.044
## 312  2023 0.020
## 313  2023 0.034
## 314  2023 0.028
## 315  2023 0.027
## 316  2023 0.035
## 317  2023 0.027
## 318  2023 0.033
## 319  2023 0.026
## 320  2023 0.033
## 321  2023 0.029
## 322  2023 0.029
## 323  2023 0.025
## 324  2023 0.031
## 325  2023 0.033
## 326  2023 0.033
## 327  2023 0.032
## 328  2023 0.035
## 329  2023 0.033
## 330  2023 0.026
## 331  2023 0.028
## 332  2023 0.030
## 333  2023 0.032
## 334  2023 0.037
## 335  2023 0.031
## 336  2023 0.028
## 337  2023 0.029
## 338  2023 0.026
## 339  2023 0.028
## 340  2023 0.038
## 341  2023 0.022
## 342  2023 0.034
## 343  2023 0.031
## 344  2023 0.022
## 345  2023 0.023
## 346  2023 0.026
## 347  2023 0.016
## 348  2023 0.022
## 349  2023 0.025
## 350  2023 0.022
## 351  2023 0.021
## 352  2023 0.015
## 353  2023 0.032
## 354  2023 0.031
## 355  2023 0.038
## 356  2013 0.022
## 357  2013 0.015
## 358  2013 0.017
## 359  2013 0.015
## 360  2013 0.023
## 361  2013 0.021
## 362  2013 0.017
## 363  2013 0.019
## 364  2013 0.030
## 365  2013 0.030
## 366  2013 0.025
## 367  2013 0.024
## 368  2013 0.025
## 369  2013 0.023
## 370  2013 0.024
## 371  2013 0.021
## 372  2013 0.022
## 373  2013 0.021
## 374  2013 0.022
## 375  2013 0.026
## 376  2013 0.026
## 377  2013 0.019
## 378  2013 0.006
## 379  2013 0.006
## 380  2013 0.028
## 381  2013 0.028
## 382  2013 0.027
## 383  2013 0.022
## 384  2013 0.026
## 385  2013 0.025
## 386  2013 0.028
## 387  2013 0.029
## 388  2013 0.029
## 389  2013 0.022
## 390  2013 0.017
## 391  2013 0.027
## 392  2013 0.027
## 393  2013 0.027
## 394  2013 0.032
## 395  2013 0.029
## 396  2013 0.031
## 397  2013 0.031
## 398  2013 0.030
## 399  2013 0.036
## 400  2013 0.028
## 401  2013 0.032
## 402  2013 0.030
## 403  2013 0.030
## 404  2013 0.024
## 405  2013 0.026
## 406  2013 0.027
## 407  2013 0.034
## 408  2013 0.030
## 409  2013 0.031
## 410  2013 0.030
## 411  2013 0.035
## 412  2013 0.030
## 413  2013 0.036
## 414  2013 0.042
## 415  2013 0.031
## 416  2013 0.029
## 417  2013 0.031
## 418  2013 0.024
## 419  2013 0.025
## 420  2013 0.024
## 421  2013 0.028
## 422  2013 0.032
## 423  2013 0.033
## 424  2013 0.041
## 425  2013 0.044
## 426  2013 0.045
## 427  2013 0.035
## 428  2013 0.037
## 429  2013 0.032
## 430  2013 0.038
## 431  2013 0.029
## 432  2013 0.029
## 433  2013 0.041
## 434  2013 0.041
## 435  2013 0.044
## 436  2013 0.041
## 437  2013 0.033
## 438  2013 0.031
## 439  2013 0.032
## 440  2013 0.037
## 441  2013 0.036
## 442  2013 0.034
## 443  2013 0.032
## 444  2013 0.032
## 445  2013 0.033
## 446  2013 0.040
## 447  2013 0.039
## 448  2013 0.038
## 449  2013 0.037
## 450  2013 0.055
## 451  2013 0.058
## 452  2013 0.063
## 453  2013 0.063
## 454  2013 0.058
## 455  2013 0.079
## 456  2013 0.080
## 457  2013 0.074
## 458  2013 0.051
## 459  2013 0.051
## 460  2013 0.051
## 461  2013 0.056
## 462  2013 0.059
## 463  2013 0.064
## 464  2013 0.072
## 465  2013 0.067
## 466  2013 0.065
## 467  2013 0.056
## 468  2013 0.059
## 469  2013 0.050
## 470  2013 0.053
## 471  2013 0.057
## 472  2013 0.060
## 473  2013 0.069
## 474  2013 0.057
## 475  2013 0.051
## 476  2013 0.050
## 477  2013 0.062
## 478  2013 0.057
## 479  2013 0.041
## 480  2013 0.032
## 481  2013 0.048
## 482  2013 0.056
## 483  2013 0.062
## 484  2013 0.068
## 485  2013 0.082
## 486  2013 0.067
## 487  2013 0.074
## 488  2013 0.066
## 489  2013 0.069
## 490  2013 0.069
## 491  2013 0.083
## 492  2013 0.091
## 493  2013 0.063
## 494  2013 0.049
## 495  2013 0.062
## 496  2013 0.069
## 497  2013 0.051
## 498  2013 0.057
## 499  2013 0.074
## 500  2013 0.046
## 501  2013 0.047
## 502  2013 0.045
## 503  2013 0.046
## 504  2013 0.051
## 505  2013 0.053
## 506  2013 0.059
## 507  2013 0.029
## 508  2013 0.029
## 509  2013 0.033
## 510  2013 0.032
## 511  2013 0.047
## 512  2013 0.058
## 513  2013 0.056
## 514  2013 0.062
## 515  2013 0.075
## 516  2013 0.080
## 517  2013 0.081
## 518  2013 0.078
## 519  2013 0.053
## 520  2013 0.067
## 521  2013 0.073
## 522  2013 0.082
## 523  2013 0.075
## 524  2013 0.069
## 525  2013 0.072
## 526  2013 0.071
## 527  2013 0.072
## 528  2013 0.065
## 529  2013 0.065
## 530  2013 0.060
## 531  2013 0.063
## 532  2013 0.069
## 533  2013 0.074
## 534  2013 0.080
## 535  2013 0.073
## 536  2013 0.066
## 537  2013 0.056
## 538  2013 0.070
## 539  2013 0.077
## 540  2013 0.068
## 541  2013 0.065
## 542  2013 0.064
## 543  2013 0.074
## 544  2013 0.085
## 545  2013 0.065
## 546  2013 0.052
## 547  2013 0.067
## 548  2013 0.060
## 549  2013 0.064
## 550  2013 0.059
## 551  2013 0.064
## 552  2013 0.049
## 553  2013 0.046
## 554  2013 0.062
## 555  2013 0.052
## 556  2013 0.055
## 557  2013 0.057
## 558  2013 0.064
## 559  2013 0.064
## 560  2013 0.056
## 561  2013 0.049
## 562  2013 0.050
## 563  2013 0.049
## 564  2013 0.083
## 565  2013 0.080
## 566  2013 0.058
## 567  2013 0.057
## 568  2013 0.054
## 569  2013 0.052
## 570  2013 0.038
## 571  2013 0.046
## 572  2013 0.060
## 573  2013 0.053
## 574  2013 0.046
## 575  2013 0.054
## 576  2013 0.061
## 577  2013 0.044
## 578  2013 0.034
## 579  2013 0.051
## 580  2013 0.057
## 581  2013 0.053
## 582  2013 0.064
## 583  2013 0.079
## 584  2013 0.074
## 585  2013 0.061
## 586  2013 0.060
## 587  2013 0.053
## 588  2013 0.062
## 589  2013 0.059
## 590  2013 0.057
## 591  2013 0.042
## 592  2013 0.050
## 593  2013 0.046
## 594  2013 0.050
## 595  2013 0.066
## 596  2013 0.052
## 597  2013 0.035
## 598  2013 0.044
## 599  2013 0.056
## 600  2013 0.057
## 601  2013 0.038
## 602  2013 0.035
## 603  2013 0.056
## 604  2013 0.046
## 605  2013 0.043
## 606  2013 0.044
## 607  2013 0.047
## 608  2013 0.037
## 609  2013 0.051
## 610  2013 0.051
## 611  2013 0.060
## 612  2013 0.060
## 613  2013 0.047
## 614  2013 0.034
## 615  2013 0.046
## 616  2013 0.052
## 617  2013 0.056
## 618  2013 0.043
## 619  2013 0.046
## 620  2013 0.060
## 621  2013 0.055
## 622  2013 0.067
## 623  2013 0.064
## 624  2013 0.067
## 625  2013 0.070
## 626  2013 0.057
## 627  2013 0.062
## 628  2013 0.056
## 629  2013 0.059
## 630  2013 0.063
## 631  2013 0.062
## 632  2013 0.037
## 633  2013 0.034
## 634  2013 0.034
## 635  2013 0.037
## 636  2013 0.044
## 637  2013 0.054
## 638  2013 0.035
## 639  2013 0.031
## 640  2013 0.037
## 641  2013 0.041
## 642  2013 0.033
## 643  2013 0.044
## 644  2013 0.050
## 645  2013 0.061
## 646  2013 0.051
## 647  2013 0.036
## 648  2013 0.051
## 649  2013 0.035
## 650  2013 0.036
## 651  2013 0.040
## 652  2013 0.040
## 653  2013 0.033
## 654  2013 0.032
## 655  2013 0.020
## 656  2013 0.023
## 657  2013 0.032
## 658  2013 0.033
## 659  2013 0.035
## 660  2013 0.039
## 661  2013 0.031
## 662  2013 0.025
## 663  2013 0.021
## 664  2013 0.026
## 665  2013 0.034
## 666  2013 0.026
## 667  2013 0.021
## 668  2013 0.024
## 669  2013 0.019
## 670  2013 0.025
## 671  2013 0.028
## 672  2013 0.016
## 673  2013 0.017
## 674  2013 0.023
## 675  2013 0.026
## 676  2013 0.029
## 677  2013 0.028
## 678  2013 0.039
## 679  2013 0.029
## 680  2013 0.021
## 681  2013 0.040
## 682  2003 0.034
## 683  2003 0.030
## 684  2003 0.015
## 685  2003 0.018
## 686  2003 0.022
## 687  2003 0.029
## 688  2003 0.020
## 689  2003 0.012
## 690  2003 0.025
## 691  2003 0.040
## 692  2003 0.020
## 693  2003 0.022
## 694  2003 0.018
## 695  2003 0.020
## 696  2003 0.027
## 697  2003 0.018
## 698  2003 0.019
## 699  2003 0.016
## 700  2003 0.017
## 701  2003 0.021
## 702  2003 0.020
## 703  2003 0.019
## 704  2003 0.023
## 705  2003 0.024
## 706  2003 0.017
## 707  2003 0.028
## 708  2003 0.021
## 709  2003 0.023
## 710  2003 0.033
## 711  2003 0.024
## 712  2003 0.023
## 713  2003 0.035
## 714  2003 0.034
## 715  2003 0.032
## 716  2003 0.031
## 717  2003 0.036
## 718  2003 0.042
## 719  2003 0.034
## 720  2003 0.043
## 721  2003 0.044
## 722  2003 0.040
## 723  2003 0.044
## 724  2003 0.023
## 725  2003 0.038
## 726  2003 0.036
## 727  2003 0.034
## 728  2003 0.052
## 729  2003 0.039
## 730  2003 0.043
## 731  2003 0.041
## 732  2003 0.041
## 733  2003 0.042
## 734  2003 0.046
## 735  2003 0.046
## 736  2003 0.039
## 737  2003 0.036
## 738  2003 0.046
## 739  2003 0.044
## 740  2003 0.043
## 741  2003 0.048
## 742  2003 0.050
## 743  2003 0.046
## 744  2003 0.047
## 745  2003 0.050
## 746  2003 0.052
## 747  2003 0.056
## 748  2003 0.057
## 749  2003 0.048
## 750  2003 0.043
## 751  2003 0.046
## 752  2003 0.038
## 753  2003 0.043
## 754  2003 0.055
## 755  2003 0.052
## 756  2003 0.053
## 757  2003 0.052
## 758  2003 0.049
## 759  2003 0.054
## 760  2003 0.049
## 761  2003 0.057
## 762  2003 0.038
## 763  2003 0.052
## 764  2003 0.049
## 765  2003 0.049
## 766  2003 0.055
## 767  2003 0.052
## 768  2003 0.066
## 769  2003 0.076
## 770  2003 0.065
## 771  2003 0.040
## 772  2003 0.056
## 773  2003 0.063
## 774  2003 0.054
## 775  2003 0.059
## 776  2003 0.061
## 777  2003 0.053
## 778  2003 0.068
## 779  2003 0.068
## 780  2003 0.055
## 781  2003 0.055
## 782  2003 0.053
## 783  2003 0.059
## 784  2003 0.061
## 785  2003 0.059
## 786  2003 0.060
## 787  2003 0.054
## 788  2003 0.062
## 789  2003 0.071
## 790  2003 0.067
## 791  2003 0.060
## 792  2003 0.062
## 793  2003 0.063
## 794  2003 0.043
## 795  2003 0.061
## 796  2003 0.060
## 797  2003 0.064
## 798  2003 0.059
## 799  2003 0.057
## 800  2003 0.061
## 801  2003 0.058
## 802  2003 0.053
## 803  2003 0.051
## 804  2003 0.060
## 805  2003 0.057
## 806  2003 0.053
## 807  2003 0.057
## 808  2003 0.060
## 809  2003 0.065
## 810  2003 0.075
## 811  2003 0.077
## 812  2003 0.073
## 813  2003 0.049
## 814  2003 0.070
## 815  2003 0.082
## 816  2003 0.081
## 817  2003 0.078
## 818  2003 0.077
## 819  2003 0.079
## 820  2003 0.082
## 821  2003 0.079
## 822  2003 0.098
## 823  2003 0.054
## 824  2003 0.050
## 825  2003 0.072
## 826  2003 0.090
## 827  2003 0.098
## 828  2003 0.064
## 829  2003 0.065
## 830  2003 0.081
## 831  2003 0.083
## 832  2003 0.099
## 833  2003 0.104
## 834  2003 0.098
## 835  2003 0.096
## 836  2003 0.088
## 837  2003 0.084
## 838  2003 0.082
## 839  2003 0.080
## 840  2003 0.066
## 841  2003 0.063
## 842  2003 0.070
## 843  2003 0.056
## 844  2003 0.075
## 845  2003 0.088
## 846  2003 0.087
## 847  2003 0.089
## 848  2003 0.054
## 849  2003 0.052
## 850  2003 0.067
## 851  2003 0.072
## 852  2003 0.077
## 853  2003 0.068
## 854  2003 0.074
## 855  2003 0.087
## 856  2003 0.098
## 857  2003 0.099
## 858  2003 0.085
## 859  2003 0.087
## 860  2003 0.077
## 861  2003 0.066
## 862  2003 0.082
## 863  2003 0.072
## 864  2003 0.084
## 865  2003 0.091
## 866  2003 0.075
## 867  2003 0.072
## 868  2003 0.081
## 869  2003 0.090
## 870  2003 0.072
## 871  2003 0.082
## 872  2003 0.057
## 873  2003 0.068
## 874  2003 0.088
## 875  2003 0.086
## 876  2003 0.067
## 877  2003 0.107
## 878  2003 0.094
## 879  2003 0.064
## 880  2003 0.097
## 881  2003 0.110
## 882  2003 0.093
## 883  2003 0.067
## 884  2003 0.102
## 885  2003 0.086
## 886  2003 0.078
## 887  2003 0.091
## 888  2003 0.088
## 889  2003 0.089
## 890  2003 0.091
## 891  2003 0.073
## 892  2003 0.079
## 893  2003 0.067
## 894  2003 0.061
## 895  2003 0.072
## 896  2003 0.079
## 897  2003 0.072
## 898  2003 0.070
## 899  2003 0.087
## 900  2003 0.083
## 901  2003 0.088
## 902  2003 0.077
## 903  2003 0.090
## 904  2003 0.098
## 905  2003 0.090
## 906  2003 0.073
## 907  2003 0.092
## 908  2003 0.059
## 909  2003 0.053
## 910  2003 0.072
## 911  2003 0.079
## 912  2003 0.082
## 913  2003 0.098
## 914  2003 0.064
## 915  2003 0.060
## 916  2003 0.070
## 917  2003 0.107
## 918  2003 0.093
## 919  2003 0.098
## 920  2003 0.098
## 921  2003 0.097
## 922  2003 0.083
## 923  2003 0.077
## 924  2003 0.070
## 925  2003 0.067
## 926  2003 0.064
## 927  2003 0.046
## 928  2003 0.067
## 929  2003 0.083
## 930  2003 0.087
## 931  2003 0.078
## 932  2003 0.081
## 933  2003 0.077
## 934  2003 0.071
## 935  2003 0.066
## 936  2003 0.063
## 937  2003 0.089
## 938  2003 0.096
## 939  2003 0.103
## 940  2003 0.104
## 941  2003 0.108
## 942  2003 0.073
## 943  2003 0.066
## 944  2003 0.080
## 945  2003 0.084
## 946  2003 0.086
## 947  2003 0.057
## 948  2003 0.075
## 949  2003 0.056
## 950  2003 0.068
## 951  2003 0.063
## 952  2003 0.079
## 953  2003 0.057
## 954  2003 0.070
## 955  2003 0.064
## 956  2003 0.059
## 957  2003 0.052
## 958  2003 0.049
## 959  2003 0.060
## 960  2003 0.065
## 961  2003 0.067
## 962  2003 0.058
## 963  2003 0.068
## 964  2003 0.097
## 965  2003 0.059
## 966  2003 0.069
## 967  2003 0.089
## 968  2003 0.065
## 969  2003 0.045
## 970  2003 0.062
## 971  2003 0.081
## 972  2003 0.090
## 973  2003 0.086
## 974  2003 0.082
## 975  2003 0.056
## 976  2003 0.046
## 977  2003 0.034
## 978  2003 0.045
## 979  2003 0.049
## 980  2003 0.039
## 981  2003 0.034
## 982  2003 0.043
## 983  2003 0.043
## 984  2003 0.047
## 985  2003 0.038
## 986  2003 0.043
## 987  2003 0.035
## 988  2003 0.033
## 989  2003 0.016
## 990  2003 0.045
## 991  2003 0.041
## 992  2003 0.031
## 993  2003 0.038
## 994  2003 0.030
## 995  2003 0.029
## 996  2003 0.032
## 997  2003 0.025
## 998  2003 0.042
## 999  2003 0.042
## 1000 2003 0.039
## 1001 2003 0.019
## 1002 2003 0.037
## 1003 2003 0.037
## 1004 2003 0.040
## 1005 2003 0.022
## 1006 2003 0.016
## 1007 2003 0.009
## 1008 2003 0.036
## 1009 2003 0.035
## 1010 2003 0.018
## 1011 2003 0.019
## 1012 2003 0.018
## 1013 2003 0.018
## 1014 2003 0.043
## 1015 2003 0.026
## 1016 2003 0.035
## 1017 2003 0.034
## 1018 2003 0.036
## 1019 2003 0.025
## 1020 2003 0.035
## 1021 2003 0.045
## 1022 2003 0.023
## 1023 2003 0.026
## 1024 2003 0.017
## 1025 2003 0.021
## 1026 2003 0.019
## 1027 2003 0.021
## 1028 2003 0.024
## 1029 2003 0.026
## 1030 2003 0.039
## 1031 2003 0.041
## 1032 2003 0.044
## 1033 2003 0.039
## 1034 2003 0.037
## 1035 2003 0.035
## 1036 2003 0.049
## 1037 2003 0.036
#checking our datasets
library(ggplot2)
ggplot(O2_data, aes(x = Year, y = O2)) +
  geom_boxplot(outlier.shape = NA, fill = "lightblue") +
  geom_jitter(width = 0.1, alpha = 0.6) +
  labs(
    title = "Daily Max 8 Hr Ozone by Year",
    x = "Year",
    y = "Ozone (ppm)"
  ) +
  theme_minimal()

#check for normality

par(mfrow = c(1, 3))

qqnorm(O2_data$O2[O2_data$Year == "2003"], main = "2003")
qqline(O2_data$O2[O2_data$Year == "2003"])

qqnorm(O2_data$O2[O2_data$Year == "2013"], main = "2013")
qqline(O2_data$O2[O2_data$Year == "2013"])

qqnorm(O2_data$O2[O2_data$Year == "2023"], main = "2023")
qqline(O2_data$O2[O2_data$Year == "2023"])

shapiro.test(O2_data$O2[O2_data$Year == "2003"])
## 
##  Shapiro-Wilk normality test
## 
## data:  O2_data$O2[O2_data$Year == "2003"]
## W = 0.97993, p-value = 7.269e-05
shapiro.test(O2_data$O2[O2_data$Year == "2013"])
## 
##  Shapiro-Wilk normality test
## 
## data:  O2_data$O2[O2_data$Year == "2013"]
## W = 0.97358, p-value = 1.086e-05
shapiro.test(O2_data$O2[O2_data$Year == "2023"])
## 
##  Shapiro-Wilk normality test
## 
## data:  O2_data$O2[O2_data$Year == "2023"]
## W = 0.98031, p-value = 8.94e-05
#p > 0.05 → fail to reject normality (✔ assumption met)

#p ≤ 0.05 → evidence of non-normality

Normality was assessed using Q–Q plots and Shapiro–Wilk tests for each year (2003, 2013, and 2023). From the Q-Q plots, this indicated normality in all groups, and a further Shapiro–Wilk test also supported normality (p > 0.05); therefore, we will proceed testing with parametric methods.

#checking for homoscedasticity
bartlett.test(O2 ~ Year, data = O2_data)
## 
##  Bartlett test of homogeneity of variances
## 
## data:  O2 by Year
## Bartlett's K-squared = 115.8, df = 2, p-value < 2.2e-16
#p > 0.05 → homogeneity satisfied (✔ assumption met)
#p ≤ 0.05 → variances differ

cat("Bartlett’s test was significant (p > 0.05)\n")
## Bartlett’s test was significant (p > 0.05)
cat("This means that our assumption of homogeneity of variance is violated.\n")
## This means that our assumption of homogeneity of variance is violated.
cat("We will proceed with Welch's ANOVA.\n")
## We will proceed with Welch's ANOVA.
cat("H₀: Mean Ozone is the same in 2003, 2013, and 2023\n")
## H₀: Mean Ozone is the same in 2003, 2013, and 2023
cat("H₁: At least one year has a different mean Ozone \n")
## H₁: At least one year has a different mean Ozone
oneway.test(O2 ~ Year, data = O2_data)   
## 
##  One-way analysis of means (not assuming equal variances)
## 
## data:  O2 and Year
## F = 39.034, num df = 2.00, denom df = 650.36, p-value < 2.2e-16
#p < 0.05 → Reject H₀

cat("Because p-value is less than alpha, we reject the null hypothesis. We conclude that there is strong statistical evidence that mean ozone concentrations differ among years (2003, 2013, and 2023), even after accounting for unequal variances.\n")
## Because p-value is less than alpha, we reject the null hypothesis. We conclude that there is strong statistical evidence that mean ozone concentrations differ among years (2003, 2013, and 2023), even after accounting for unequal variances.

A one-way ANOVA indicated a significant effect of year on mean concentrations p (2E-16) < 0.05

#running posthoc tests

library(rstatix)
## 
## Attaching package: 'rstatix'
## The following object is masked from 'package:stats':
## 
##     filter
games_howell_test(O2_data, O2 ~ Year)
## # A tibble: 3 × 8
##   .y.   group1 group2  estimate conf.low conf.high    p.adj p.adj.signif
## * <chr> <chr>  <chr>      <dbl>    <dbl>     <dbl>    <dbl> <chr>       
## 1 O2    2003   2013   -0.0116   -0.0153   -0.00783 0        ****        
## 2 O2    2003   2023   -0.0124   -0.0158   -0.00903 4.53e-10 ****        
## 3 O2    2013   2023   -0.000845 -0.00367   0.00198 7.62e- 1 ns

Games-Howell post hoc tests indicated that mean ozone concentrations in 2003 were significantly higher than in both 2013 and 2023 (p < 0.05), while no significant difference was observed between 2013 and 2023.

SUMMARY

The years 2003, 2013, and 2023 were treated as categorical groups to test whether the average daily 8 hr maximum ozone (O3) concentrations differed across the years. The null hypothesis (H₀) states that the mean daily maximum ozone concentration was the same across all three years, while the alternative hypothesis (H₁) states that at least one year had a different mean concentration.

Before conducting ANOVA, the assumptions of normality and homoscedasticity were evaluated. Normality was assessed using Q–Q plots and Shapiro–Wilk tests for each year. The Q–Q plots for all years indicated normality, and Shapiro–Wilk tests also supported normality (p > 0.05), suggesting that I can move forward with parametric methods.

Homogeneity of variance was assessed using Bartlett’s test, which indicated a significant difference in variances among years (p = 2.2 E-16 is less than alpha = 0.05). This result suggests that the assumption of equal variances is violated; therefore, I proceeded with Welch’s ANOVA to conduct the analysis.

Welch’s ANOVA was conducted to assess differences in the average daily maximum ozone concentrations across years. The ANOVA indicated a significant effect of year on average daily maximum ozone concentrations (p = 2E-16 which is less than our alpha = 0.05), leading us to reject the null hypothesis. This means that at least one year has a significantly different average daily maximum ozone concentration compared to the others.

Post hoc comparisons using Games–Howell showed that mean concentrations in 2003 were significantly higher than in both 2013 and 2023 (p < 0.05), while no significant difference was observed between 2013 and 2023.

The significant difference observed between 2003 and the later years most likely reflects policy shifts aimed at reducing air pollutants in San Joaquin Valley. In the early 2000s, ozone concentrations in SJV were influenced by primarily from higher emissions of nitrogen oxides (NOₓ) and volatile organic compounds (VOCs) which can come from a variety of sources such as agricultural equipment and industrial activities (California Air Resources Board [CARB], 2022; San Joaquin Valley Air Pollution Control District [SJVAPCD], 2020). This came before the full implementation and fleet turnover impacts of major state and federal air quality regulations. As tighter emission standards were enacted and cleaner vehicle technologies became prevalent, emissions of critical ozone precursors decreased, resulting in significant changes in ozone concentrations compared to 2003 monitoring.

Thus, the significant difference observed between 2003 and the later years likely reflects structural changes in air quality over time, including stricter emission standards for nitrogen oxides (NOₓ) and volatile organic compounds (VOCs), improved vehicle technology, and changes in industrial emissions following early-2000s air quality regulations.

On the other hand, the lack of a statistically significant difference between 2013 and 2023 indicates that ozone levels in recent years may have either stabilized or declined at a slower rate. While a continuous reduction in precursor emissions has been facilitated by regulatory measures, the scale of further improvements has slowed down, reflecting continued effects of existing policies and the increasing difficulty of achieving additional reductions as emissions approach lower levels.

References

California Air Resources Board (CARB). (2022). 2022

San Joaquin Valley ozone plan. San Joaquin Valley Air Pollution Control District (SJVAPCD). (2020). 2018 plan for the 2008 8-hour ozone standard.