The intention of developing this digital product on the RStudio platform is to provide a repeatable methodology that can be replicated for similar systems-of-systems analysis from a macro perspective. Applications, analysis, data science, and analytics platforms provide us with the ability to apply repeatable methodologies to achieve a variety of organizational functions while providing the ability to guide investments and future decision-making. The scientific objective of this investigation seeks to determine the relationships between the systems and how one system (outdoor air quality), can influence changes in another system (healthcare utilization).
We have the ability to hypothesize that pollution is not healthy for the environment or human health, however that generalization can be more specifically understood with data science, analysis, mathematical, and statistical processes.
This analysis includes three objectives:
These objectives are supported using statistical analysis, mathematics, and data science techniques. Present and historic data is used to obtain forecasts that have not been obtained or published, which provides an opportunity for to guide future decisions for the environment and human health.
The datasets used for this analysis include:
The RStudio platform provides the ability to show the data and processes which accompany this analysis, as well as create a platform that can be continually developed for improvements, updating, and modifying data.
The process for analyzing this data is shown in the following diagram.
The processes for standardizing the data for this report included:
Estimates of county population totals have been collected by the U.S. Census Bureau for the years specified in this project.
Import Population Data and Review Summary Statistics Summary statistics provide the ability to review the data, including the data classification, as well as minimum, maximum, mean, median, and quartiles (1st/3rd).
options(width = 60)
Pop <- read.table("01-Population/CAPop_2012-2021.csv",header=TRUE,sep=",")
summary(Pop[1:12])
## county X2010 X2011
## Length:59 Min. : 1161 Min. : 1093
## Class :character 1st Qu.: 50329 1st Qu.: 49995
## Mode :character Median : 181136 Median : 180936
## Mean : 1265068 Mean : 1275877
## 3rd Qu.: 703413 3rd Qu.: 711349
## Max. :37319502 Max. :37638369
## X2012 X2013 X2014
## Min. : 1110 Min. : 1128 Min. : 1080
## 1st Qu.: 49518 1st Qu.: 49326 1st Qu.: 49261
## Median : 180575 Median : 181481 Median : 183108
## Mean : 1286400 Mean : 1296976 Mean : 1308372
## 3rd Qu.: 719408 3rd Qu.: 725354 3rd Qu.: 734392
## Max. :37948800 Max. :38260787 Max. :38596972
## X2015 X2016 X2017
## Min. : 1077 Min. : 1047 Min. : 1111
## 1st Qu.: 49290 1st Qu.: 49546 1st Qu.: 49828
## Median : 184569 Median : 185976 Median : 188679
## Mean : 1319256 Mean : 1327699 Mean : 1334186
## 3rd Qu.: 743663 3rd Qu.: 750358 3rd Qu.: 756098
## Max. :38918045 Max. :39167117 Max. :39358497
## X2018 X2019 X2020
## Min. : 1089 Min. : 1129 Min. : 1198
## 1st Qu.: 50042 1st Qu.: 50192 1st Qu.: 50422
## Median : 190746 Median : 192843 Median : 191114
## Mean : 1337681 Mean : 1339397 Mean : 1338974
## 3rd Qu.: 760586 3rd Qu.: 764360 3rd Qu.: 771485
## Max. :39461588 Max. :39512223 Max. :39499738
The population data initially obtained was for the duration of 2012-2020, however this project was seeking to create forecasted data for 2021.
There are a few different statistical methods that can be used to forecast future data, and a common method used for population includes the Modified Exponential Equation to measure the population over time. The average of the years will be taken into consideration to provide the anticipated result for the final year being calculated. The formula and processes are shown below:
\[ModifiedExponential Equation
(population) = target year + (Year 1 + Year 2)^{Time}\]
These process steps can be completed internally using the R platform, as
well as using a multitude of software and database applications.
This data was produced and extracted to a new .csv file for the year 2021 providing the following results.
## X2021
## Min. : 1056
## 1st Qu.: 51462
## Median : 194970
## Mean : 1338910
## 3rd Qu.: 759332
## Max. :39497840
The United States Environmental Protection Agency (EPA) has implemented and managed a variety of outdoor air quality sensors. The data collected includes the geolocations and the type of air quality that is being measured. The datasets are available for download, with the link provided within the reference section.
knitr::include_graphics("06-Images/03-EPA.jpg", dpi = 150)
Source: Environmental Protection Agency (EPA) Outdoor Air Quality
Data Download Website2
The outdoor air quality data consists of fourteen categories across the country, however these vary by county. Within the State of California, there was limited data associated with sulfphur dioxide (SO2) and lead particulates, which was insufficient to perform statistical and mathematical analysis to determine strong correlations. There was sufficient data to provide analysis with ten sensors for 202 county entries between the years of 2012-2021.
A description of the outdoor air quality sensors include:
• Ozone (O3) 2nd Max, 4th Max: The four highest “daily max values” in parts per million by volume (ppm). Take the highest 1-hour value of each day, and pick the top four of those values.
• PM2.5 98th %ile: For PM2.5, the 98th percentile of the daily average measurements in the year. (Note: PM2.5 data reported as parameter 88502 are not included in this summary report. Only federal reference method PM2.5 data reported as parameter 88101 are included in this report.)
• PM2.5 Wtd Mean: For PM2.5, the Weighted Annual Mean (mean weighted by calendar quarter) for the year. (Note: PM2.5 data reported as parameter 88502 are not included in this summary report. Only federal reference method PM2.5 data reported as parameter 88101 are included in this report.)
• PM10 24-hr 2nd Max: For PM10, the 2nd highest 24-hour average measurement in the year.
• PM10 Annual Mean: For PM10, the Weighted Annual Mean (mean weighted by calendar quarter) for the year.
• CO 1-hr 2nd Max: For Carbon Monoxide, the 2nd highest 1-hour measurement in the year.
• CO 8-hr 2nd Max: For Carbon Monoxide, the 2nd highest non-overlapping 8-hour average in the year.
• NO2 98th %ile: For Nitrogen Dioxide, the 98th percentile of the daily max 1-hour measurements in the year.
• NO2 Annual Mean: For Nitrogen Dioxide, the annual mean of all the 1-hour measurements in the year.
Image: Outdoor Air Quality Sensors
Outdoor Air Quality Data, Sensor Variables
## [1] "CO_2M_1h" "CO_2M_8h" "County"
## [4] "NO2_98thP_1h" "NO2_Mean_1h" "Oz_2M_1h"
## [7] "Oz_5M_8h" "PM10_2M_24h" "PM10_Mn_24h"
## [10] "PM2.5_98P_24h" "PM2.5_WM_24h" "Year"
Outdoor Air Quality Sensor Summary Statistics
## Year County CO_2M_1h
## Min. :2012 Length:202 Min. : 0.60
## 1st Qu.:2014 Class :character 1st Qu.: 1.70
## Median :2016 Mode :character Median : 2.20
## Mean :2016 Mean : 2.84
## 3rd Qu.:2019 3rd Qu.: 2.88
## Max. :2021 Max. :24.10
## CO_2M_8h NO2_98thP_1h NO2_Mean_1h
## Min. :0.50 Min. :17.0 Min. : 2.0
## 1st Qu.:1.10 1st Qu.:37.0 1st Qu.: 8.0
## Median :1.50 Median :47.0 Median :11.0
## Mean :1.71 Mean :47.2 Mean :12.2
## 3rd Qu.:1.90 3rd Qu.:56.0 3rd Qu.:15.0
## Max. :6.70 Max. :96.0 Max. :32.0
## Oz_2M_1h Oz_5M_8h PM2.5_98P_24h
## Min. :0.0500 Min. :0.0430 Min. : 8
## 1st Qu.:0.0800 1st Qu.:0.0640 1st Qu.: 24
## Median :0.1000 Median :0.0755 Median : 35
## Mean :0.0973 Mean :0.0762 Mean : 39
## 3rd Qu.:0.1100 3rd Qu.:0.0850 3rd Qu.: 47
## Max. :0.1700 Max. :0.1250 Max. :144
## PM2.5_WM_24h PM10_2M_24h PM10_Mn_24h
## Min. : 3.10 Min. : 21 Min. :11.0
## 1st Qu.: 8.72 1st Qu.: 51 1st Qu.:19.0
## Median :11.00 Median : 87 Median :25.5
## Mean :11.46 Mean :117 Mean :29.2
## 3rd Qu.:13.68 3rd Qu.:154 3rd Qu.:36.0
## Max. :22.80 Max. :465 Max. :65.0
The next step of this process included reviewing the entirety of the data to determine the strongest correlated relationships between the air quality sensors. The data was standardized which contained 202 counties that contained ten air quality sensors.
Applying the Pearson Correlation Coefficient Analysis The Pearson correlation coefficient (PCC) is also known as Pearson’s r, the Pearson product-moment correlation coefficient (PPMCC), bivariate correlation, or simply as the correlation coefficient. The Pearson Correlation Coefficient formula used to understand strong and weak relationships to measure the standard deviation, which is a normalized measurement of the covariance value between +1 (indicating a strong relationship), and -1 (indicating a weak relationship). It provides the ability to measure the linear correlations between two sets of data, and is the ratio between the covariance of two variables and the product of their standard deviations. The simplified formula is as follows:
\[Pearson Correlation Coefficient_{xy} = \frac {n({\sum}_{xy})-({\sum}_{x})({\sum}_{y})}{\sqrt(n\sum_{x^2}-(\sum_{x^2}))(n\sum_{y^2}-(\sum_{y^2}))}\] Correlation is measured by \(r\), where \(n\) is the sample size, and \(x\) and \(y\) are the sample means of x and y values.
Correlated Air Quality Sensor Data Values
options(width = 60)
aqdata.cor = cor(AQSD[3:12])
corplot <- round(aqdata.cor,2)
corplot
## CO_2M_1h CO_2M_8h NO2_98thP_1h NO2_Mean_1h
## CO_2M_1h 1.00 0.82 0.27 0.24
## CO_2M_8h 0.82 1.00 0.44 0.33
## NO2_98thP_1h 0.27 0.44 1.00 0.87
## NO2_Mean_1h 0.24 0.33 0.87 1.00
## Oz_2M_1h 0.23 0.33 0.66 0.73
## Oz_5M_8h 0.23 0.31 0.64 0.71
## PM2.5_98P_24h 0.04 0.16 0.21 0.17
## PM2.5_WM_24h 0.14 0.27 0.53 0.54
## PM10_2M_24h 0.28 0.40 0.24 0.21
## PM10_Mn_24h 0.19 0.31 0.41 0.39
## Oz_2M_1h Oz_5M_8h PM2.5_98P_24h PM2.5_WM_24h
## CO_2M_1h 0.23 0.23 0.04 0.14
## CO_2M_8h 0.33 0.31 0.16 0.27
## NO2_98thP_1h 0.66 0.64 0.21 0.53
## NO2_Mean_1h 0.73 0.71 0.17 0.54
## Oz_2M_1h 1.00 0.95 0.33 0.67
## Oz_5M_8h 0.95 1.00 0.34 0.69
## PM2.5_98P_24h 0.33 0.34 1.00 0.76
## PM2.5_WM_24h 0.67 0.69 0.76 1.00
## PM10_2M_24h 0.44 0.44 0.40 0.48
## PM10_Mn_24h 0.63 0.66 0.46 0.68
## PM10_2M_24h PM10_Mn_24h
## CO_2M_1h 0.28 0.19
## CO_2M_8h 0.40 0.31
## NO2_98thP_1h 0.24 0.41
## NO2_Mean_1h 0.21 0.39
## Oz_2M_1h 0.44 0.63
## Oz_5M_8h 0.44 0.66
## PM2.5_98P_24h 0.40 0.46
## PM2.5_WM_24h 0.48 0.68
## PM10_2M_24h 1.00 0.80
## PM10_Mn_24h 0.80 1.00
Visualization the Correlation of Air Quality Sensor Relationships The values shown within the section along with the color scheme provide the ability to understand the information more clearly. The values closer to 1 show stronger relationships.
library(corrplot)
aqdata.cor = cor(AQSD[3:12])
corrplot(aqdata.cor, method="number", number.cex = .5, tl.cex = .5)
Analyzing the Air Quality Sensor Data Values Reviewing
this correlation matrix (shown in two separate visualizations with the
same data), we can determine the most significant relationships between
the air quality sensors. For example:
This information is scientifically significant, however the intention is to determine how these air quality values are associated with populations and healthcare.
Within the State of California, the Office of Statewide Health Planning and Development requires hospitals and healthcare facilities to provide an annual utilization report. This report provides an extensive amount of information about the statistics of providers and patients within their facilities and is publicly available and can be downloaded from the sourced website.
This data has an average of 500 facilities (in which the quantity fluctuates annually) with approximately 275 categories that are quantitatively measured each year, amounting to roughly 140,000 data points each year that are collected by the state.
The initial step with the healthcare data was to standardize and determine variations with population data. Although the State of California has 58 counties, the healthcare data only covers 56 counties. Furthermore, each county contained one or multiple hospitals. The healthcare data was standardized to include the county name and a summation of the values within the county. These PIVOT tables were combined into a final spreadsheet including each year, county, as well as the type and quantity of healthcare services that were provided, amounting to over 13,000 data points for each year.
The second phase of standardization included comparing the row labels, which include information about the healthcare facilities, and the pertinent information we are seeking which includes over 240 healthcare data characteristics such as emergency room visits, licensed bed days, and many others for each county. The datasets were collected and labeled similarly between 2012-2017, 2018-2019, and 2020 in separate groups.
Healthcare Utilization Dataset List of Variables
options(width = 60)
# Hospital Utilization, sample from 2020
HUsamp <- read.table("03-HC/2020_hosp_util_dataonly.csv", header=TRUE, sep=",")
ls(HUsamp[1:5]) # Facility information
## [1] "FAC_CITY" "FAC_NAME" "FAC_NO"
## [4] "FAC_STR_ADDR" "OSHPD_ID"
ls(HUsamp[200:210]) # EMS Sample types of data
## [1] "ADMITTED_FROM_ed_TOT"
## [2] "EMS_VISITS_CRITICAL_ADMITTED"
## [3] "EMS_VISITS_MODERATE_ADMITTED"
## [4] "EMS_VISITS_NON_URGENT_ADMITTED"
## [5] "EMS_VISITS_SEVERE_ADMITTED"
## [6] "EMS_VISITS_URGENT_ADMITTED"
## [7] "ER_TRAFFIC_TOT"
## [8] "INPAT_OPER_RM"
## [9] "INPATIENT_SURG_OPER"
## [10] "OUTPAT_OPER_RM"
## [11] "OUTPATIENT_SURG_OPER"
The next objective with the healthcare data is to determine the statistical significance between healthcare and air quality data. It is important to understand that “correlation does not imply causation”, meaning that certain factors of air quality data are not the only reason that someone may visit a healthcare facility for a specific reason. However, the statistical relationships can provide the ability to forecast future utilization for some factors.
This included analyzing healthcare data between 2012-2017 (then later adding additional years with specific features), along with the outdoor air quality between the same years. The ability to determine the Pearson correlation coefficient of this data provides the ability to examine and recognize relationships between healthcare, air quality, and population.
options(width = 60)
# Hospital Utilization, sample from 2020
AQHCPOP <- read.table("05-Correlation/2020AQHCPOP.csv", header=TRUE, sep=",")
ls(AQHCPOP)
## [1] "CO.2nd.Max.1.hr"
## [2] "CO.2nd.Max.8.hr"
## [3] "County"
## [4] "NO2.98th.Percentile.1.hr"
## [5] "NO2.Mean.1.hr"
## [6] "Ozone.2nd.Max.1.hr"
## [7] "Ozone.4th.Max.8.hr"
## [8] "PM10.2nd.Max.24.hr"
## [9] "PM10.Mean.24.hr"
## [10] "PM2.5.98th.Percentile.24.hr"
## [11] "PM2.5.Weighted.Mean.24.hr"
## [12] "Population"
## [13] "Sum.of.ED_TRAFFIC_TOTL"
## [14] "Sum.of.EMS_NON_EMERG_VIS"
## [15] "Sum.of.EMS_REGISTERS_NO_TREAT"
## [16] "Sum.of.HOSP_LICBED_DAY_TOTL"
## [17] "Year"
Data Summary:
options(width = 60)
summary(AQHCPOP)
## Year County CO.2nd.Max.1.hr
## Min. :2012 Length:164 Min. : 0.60
## 1st Qu.:2014 Class :character 1st Qu.: 1.70
## Median :2016 Mode :character Median : 2.20
## Mean :2016 Mean : 2.86
## 3rd Qu.:2017 3rd Qu.: 2.80
## Max. :2019 Max. :24.10
## CO.2nd.Max.8.hr NO2.98th.Percentile.1.hr NO2.Mean.1.hr
## Min. :0.50 Min. :17.0 Min. : 2.0
## 1st Qu.:1.00 1st Qu.:38.0 1st Qu.: 8.0
## Median :1.50 Median :48.0 Median :11.0
## Mean :1.72 Mean :47.9 Mean :12.2
## 3rd Qu.:1.90 3rd Qu.:57.2 3rd Qu.:15.0
## Max. :6.70 Max. :96.0 Max. :32.0
## Ozone.2nd.Max.1.hr Ozone.4th.Max.8.hr
## Min. :0.0500 Min. :0.0430
## 1st Qu.:0.0800 1st Qu.:0.0640
## Median :0.0950 Median :0.0750
## Mean :0.0955 Mean :0.0755
## 3rd Qu.:0.1100 3rd Qu.:0.0850
## Max. :0.1600 Max. :0.1160
## PM2.5.98th.Percentile.24.hr PM2.5.Weighted.Mean.24.hr
## Min. : 8.0 Min. : 3.10
## 1st Qu.: 23.0 1st Qu.: 8.57
## Median : 32.0 Median :10.80
## Mean : 36.1 Mean :11.15
## 3rd Qu.: 43.0 3rd Qu.:13.40
## Max. :100.0 Max. :22.80
## PM10.2nd.Max.24.hr PM10.Mean.24.hr Population
## Min. : 21 Min. :11.0 Min. : 19377
## 1st Qu.: 50 1st Qu.:18.0 1st Qu.: 424506
## Median : 76 Median :25.0 Median : 834224
## Mean :109 Mean :28.3 Mean : 1434900
## 3rd Qu.:123 3rd Qu.:35.0 3rd Qu.: 1919177
## Max. :465 Max. :65.0 Max. :10105708
## Sum.of.HOSP_LICBED_DAY_TOTL Sum.of.ED_TRAFFIC_TOTL
## Min. : 16790 Min. : 0
## 1st Qu.: 284297 1st Qu.: 153223
## Median : 668192 Median : 299904
## Mean : 1344352 Mean : 495538
## 3rd Qu.: 1435373 3rd Qu.: 593590
## Max. :10834949 Max. :3823574
## Sum.of.EMS_NON_EMERG_VIS Sum.of.EMS_REGISTERS_NO_TREAT
## Min. : 0 Min. : 0
## 1st Qu.: 302 1st Qu.: 3080
## Median : 9806 Median : 7238
## Mean : 22863 Mean : 12379
## 3rd Qu.: 28166 3rd Qu.: 13194
## Max. :253781 Max. :112769
Healthcare, Air Quality, and Population Relationships: The previous dataset is shown in this correlation plot.
AQHCPOPdata.cor = cor(AQHCPOP[3:17])
corrplot(AQHCPOPdata.cor, method="number", number.cex = .5, tl.cex = .5)
# FinalCorrelation <- corrplot.mixed(AQHCPOPdata.cor, lower.col = "darkblue", order="hclust", number.cex = .7, tl.cex = .7, tl.col = "black")
This data was outputted into another program, analyzed, and shown in the following image.
Post processed image of Correlation Data
The correlation matrix indicates relationships between the variables which are measured by the Euclidean distance. The Euclidean distance is a value between zero (0) and one (1), and the higher the value the more significant the relationship between the values.
This analysis has shown that the higher presence of NO2 and Ozone, followed closely by CO have higher correlated values to licensed bed total days, emergency room traffic, as well as healthcare registrations without treatment.
Data Standardization and Final Forecasts The next step of this process included reviewing the entirety of the data to determine the maximum amount of values that were in common and occurred the most frequently for mathematical and statistical purposes. The detailed process entailed:
This diagram shows the process, which includes over 120 data objects
for over 110 counties and years, amounting to over 13,000 data points
for determining the strongest relationships using the this correlation
method. The following steps will show how this data was processed.
The scientific research performed with this data utilized several different techniques while applying analytics, data science, statistics and mathematical processes. The software platforms enabled the ability to manage, comprehend, and visualize the data using multiple platforms.
The topics of healthcare utilization, poor air quality, and the impact on human health are indicative of negative concerns for society. However, the ability to understand this information through data enables us to prepare for current and future challenges to appropriately respond.
This type of research provides many exciting opportunities to consider while improving human health, healthcare systems, and our environment that we live within.
This data was additionally represented in ESRI’s Geographical Information System platform to visualize the data, which may be accessed at https://arcg.is/19iviv.
*Data source URLS are subject to change depending upon the access date of accessing URL
Keywords Air quality, air quality sensors, California, cartography, county, analytics, data analysis, data relationships, data science, data sets, data visualization, emergency response, environment, geography, geographic information systems (GIS), healthcare data, healthcare utilization, Office of Statewide Health Planning and Development (OSHPD), pearson correlation coefficient, population, preparedness, sensors, spatial data, statistics, U.S. Census Bureau, U.S. Department of Commerce, U.S. Environmental Protection Agency.