Enhancing Public Health Data Understanding by Leveraging PCA for Aggregated Measure
Full text
Enhancing Public Health Data Understanding by Leveraging PCA for Aggregated Measure Zhixin Lun1 1Department of Biostatistics and Informatics, Colorado School of Public Health, University of Colorado Anschutz Medical Campus, Aurora, CO 80045 Abstract Principal Component Analysis (PCA) has been widely used for data reduction and clustering analysis. However, its interpretation strength has not been well applied to public health data. In matrix theory, the first principal component is the linear combination with maximum variance. The subsequent principal component is that with decreasing variance. It is straightforward to show this nature using matrix theory. However, when applied to public health data, the clinical meaning is not as easily understood as it is in mathematics. We use the American Medical Association (AMA) End the Epidemic for naloxone and opioid prescriptions yearly aggregated time series measure to propose a pipeline for analyzing national public health using PCA. Our preliminary analysis shows that the first principal component might indicate a total national trend, which is roughly weighted sum contribution from all 50 states and Washington, D.C. We also leverage heatmaps to visualize how state-level changes in the first principal component (PC1) and discover interesting patterns, including some states leading the national trend. These findings might help audience understand the national public data from a different perspective. Therefore, the proposed pipeline can enhance our public health policy by minimizing geographic health disparities. Key Words: PCA, correlation, heatmap, public health, opioid 1. Introduction Principal Component Analysis (PCA) is a statistical technique widely used for dimensionality reduction and data analysis. It is particularly valued for its ability to reduce dimensionality and visualize data for clustering. PCA provides practical interpretations based on mathematical concepts, enriching insights and revealing the underlying structure of the data. Hotelling (1933) and Rao (1964) laid foundational work in multivariate statistical theory, offering both rigorous theoretical frameworks and insightful practical methodologies that continue to influence modern statistical analysis. Several classic textbooks on multivariate statistical analysis have played a pivotal role in reinforcing the practical utility of principal component analysis (PCA), notably Johnson and Wichern (2002) and Khattree and Naik (2000), which offer comprehensive treatments of both theory and application. In this study, we aim to apply PCA in aggregated time series measures, which is one of the common data formats in public health research. Our goal is to address the following questions for nonstatistician researchers and help them better understand the insights derived from PCA results. • What is the nature of the principal components? • How can loadings and scores be converted into more practical insights?
1.1 Data Structure Aggregated time series data is a widely used and valuable resource in public health research. For example, the Centers for Disease Control and Prevention (CDC) publish COVID-19 surveillance data across all 50 states and the District of Columbia, while the American Medical Association (AMA) Advocacy Epidemic Report tracks opioid and naloxone prescriptions to monitor national trends. These datasets provide critical insights into both current conditions and long-term changes. Figure 1 illustrates total opioid prescriptions in the U.S. from 2012 to 2023, with the final two columns showing percentage changes between 2022–2023 and 2012–2023, clearly indicating a downward trend. However, dense tabular visualizations often obscure deeper patterns, such as correlations across states or over time. Curious readers may also wonder how their own state compares to the national average—whether it is leading, lagging, or aligned. PCA offers a powerful approach to uncover and visualize these latent structures, making complex relationships more interpretable and accessible. Figure 1: Total opioid prescriptions in the US from 2012 to 2023. Source: AMA Advocacy Epidemic Report (https://end-overdose-epidemic.org/wp-content/uploads/2024/11/AMA2024-Advocacy-Epidemic-report-opioid-prescriptions-IQVIA_FINAL.pdf). 1.2 Data Processing The row-column relationship is a fundamental consideration for PCA practitioners. In statistical convention, rows typically represent subjects and columns represent variables. For the aggregated time series measures shown in Figure 1, each row corresponds to a state, and each column represents the yearly aggregated opioid prescription data. A key step in data processing is to clearly define the research question, rather than assuming that public datasets are immediately ready for PCA. In this example, our goal is to uncover relationships between states—constructing principal components as combinations of states. For instance, PC1 can be expressed as: PC1=𝑎𝑎11𝑋𝑋1+𝑎𝑎12𝑋𝑋2+⋯+𝑎𝑎1𝑝𝑝𝑋𝑋𝑝𝑝, where 𝑋𝑋𝑖𝑖 indicates the opioid prescription measure for ith state and coefficient 𝑎𝑎1𝑖𝑖 represents the loading of the ith state in PC1 (we will explore loadings in more detail in the next section). This
formulation requires transposing the data frame so that states become variables and years are treated as observations. Another important consideration is the effect of population size. It is reasonable to assume that higher opioid prescription counts may correlate with larger populations. To address this, we use percentage change calculations instead of raw counts, which helps mitigate population effects. For example, the percentage change in opioid prescriptions from 2012 to 2013 can be calculated as: Change Rate2013 = Precription2013 −Precription2012 Precription2012 Similar calculations are applied across all years for each state. Table 1 shows a subset of the newly processed data matrix. The year 2012 is excluded because we do not have 2011 data to compute its change rate. This transformation offers several benefits: 1. Population normalization: The population effect is effectively canceled out if both the numerator and denominator are divided by each state's population. 2. Trend clarity: Similar to return rates in financial analysis, this approach reflects the true change trend regardless of the raw scale, making comparisons across states more meaningful. In the next section, we will perform PCA using this processed data matrix and explore the interpretation of the resulting principal components. 2. Geospatial Interpretation of Principal Components 2.1 Loading and Correlation The first principal component (PC1) is the eigenvector corresponding to the largest eigenvalue of the covariance matrix, as described in Section 1.2 and commonly found in classic textbooks. Each coefficient 𝑎𝑎1𝑖𝑖 in the eigenvector is called a loading, which can be interpreted as the weight assigned to each state. Therefore, PC1 can be viewed as a weighted average of all state measures along the direction that maximizes the variance. Although PCA is widely used in clustering analysis, clusters can often be identified by grouping points with similar values of PC1 and/or PC2. However, interpreting the loadings can be challenging, as they are unbounded (−∞,∞) and lack a fixed scale, making direct comparison of their magnitudes less straightforward. As a result, their interpretation can be less intuitive for nonstatisticians and practitioners. To address this, we propose using the correlation between the original variables and the PC1 scores as an alternative measure of alignment. These correlation values, bounded within the interval [−1, 1], offer a more interpretable and standardized metric for assessing how well each variable aligns with the principal component axes. This approach enhances accessibility and facilitates clearer communication of PCA results to broader audiences, including public health professionals and policymakers. Interestingly, the correlation between raw data and PC1 scores are proportional to the loadings. This relationship can be illustrated using 𝑋𝑋1 as an example, as follows: Table 1: Processed data matrix after transposing and calculating year-over-year percentage changes in opioid prescriptions AK AL AR AZ CA CO 2013 -0.0204 0.0004 -0.0004 -0.0456 -0.0307 -0.0211 2014 -0.0428 -0.0465 0.0259 -0.0002 -0.0278 -0.0174 2015 -0.0645 -0.0840 -0.0594 -0.0426 -0.0932 -0.0567
where 𝜆𝜆1 is the eigenvalue corresponding to PC1. If the data matrix is standardized such that 𝜎𝜎𝑋𝑋1= 1, and we can conclude that the correlation between the raw variable and PC1 score is directly related to the corresponding loading value in PC1. 2.2 Principal Component Direction An interesting exercise in Johnson & Wichern (2000) explores the application of PCA to stock market data, suggesting that PC1 may represent the overall market trend, while PC2 may capture sector-specific variations. Inspired by this, we interpret PC1 in our analysis as a representation of a national trend—capturing broad patterns shared across most states. In contrast, PC2 may reflect regional variations that deviate from the national pattern. Additionally, the sign of the loadings is consistent with the sign of the correlations between the original variables and the principal component scores. This provides a practical and intuitive insight for public health data: the sign indicates whether a state’s trend is increasing or decreasing relative to the principal component direction. 3. Application We use data from AMA 2024 Overdose Report IQVIA Data Opioid Prescribing and Data Naloxone to illustrate the application of PCA, focusing on the correlation between raw data and PC1 scores. The analysis was conducted in R (R Core Team, 2024) using the prcomp() function from stats package for PCA computation, and plot_usmap() from usmap package for heatmap generation. Figure 2 displays two heatmaps: one for the original loadings and one for the correlations between raw data and PC1 scores. We observe that the patterns in both plots are nearly identical, differing only in scale—consistent with the mathematical relationship described in Section 2.1. However, the correlation scale offers clearer and more intuitive insights for readers. We interpret PC1 as reflecting a national trend in opioid prescriptions. States shaded in dark blue are considered to be strongly aligned with this trend. In fact, the correlation values for all states range between −0.5 and −0.9, indicating a moderate to strong association with the national pattern. Moreover, the negative sign of these correlations suggests a decreasing trend in opioid prescriptions, which aligns with national efforts to reduce opioid usage. These results reflect the impact of policy interventions and suggest promising progress in addressing the opioid epidemic.
Figure 2: Left: Heatmap for original PC1 loadings based on opioid prescription change rate data. Right: Heatmap of correlations between PC1 scores and raw opioid prescription change rate data. We also applied the same pipeline to naloxone data. The AMA encourages physicians to prescribe naloxone to patients at risk of overdose, as well as to individuals who may be in a position to save a life. Therefore, we expect to observe an increasing trend in the correlation between naloxone change rate data and PC1 scores. As shown in Figure 3, all correlations are positive, indicating a continued upward trend in naloxone prescriptions. States with lower correlation values may reflect regional patterns that diverge somewhat from the national trend, suggesting that local factors could be influencing prescribing behavior more strongly than national policy. Figure 3: Heatmap of correlations between PC1 scores and raw naloxone prescription change rate data.
4. Conclusion This study demonstrates how PCA can be effectively applied to aggregated public health time series data to uncover meaningful patterns and trends. We summarize the key takeaways as follows: 1. Correlation as a proxy for loadings: The correlation between raw variables and principal component (PC) scores is proportional to the loadings in the corresponding PC. This allows us to use correlation as a more interpretable measure of association between variables and the direction of the principal components. 2. PC1 as a national trend indicator: The first principal component (PC1) can be interpreted as capturing a national trend in state-level opioid and naloxone prescription data. Visualizing the correlation between raw variables and PC1 scores using heatmaps provides a fast and intuitive summary of how each state aligns with national patterns. By transforming raw prescription data into percentage change rates and applying PCA, we offer a scalable and interpretable framework for analyzing complex public health datasets. This approach not only enhances understanding among non-statistical audiences but also supports data-driven decision-making for public health policy, particularly in identifying geographic disparities and monitoring the effectiveness of national interventions. Acknowledgements I would like to thank Prof. Debashis Ghosh for his valuable comments and support during the development of this study. I also appreciate the Center for Innovative Design and Analysis (CIDA) at the University of Colorado for providing support and the opportunity to participate in opioidrelated research projects. Conflict of Interest The authors declare no conflict of interest related to this study. References Hotelling, H. (1933). Analysis of a complex of statistical variables into principal components. Journal of educational psychology, 24(6), 417. Rao, C. R. (1964). The use and interpretation of principal component analysis in applied research. Sankhyā: The Indian Journal of Statistics, Series A, 329-358. Johnson, R. A., & Wichern, D. W. (2002). Applied multivariate statistical analysis (5th ed.). Prentice Hall. Khattree, R., & Naik, D. N. (2000). Multivariate data reduction and discrimination. SAS Institute, Cary, North Carolina. R Core Team. (2024). R: A language and environment for statistical computing. R Foundation for Statistical Computing. https://www.R-project.org/ AMA 2024 Overdose Report IQVIA Data Opioid Prescribing: https://end-overdoseepidemic.org/wp-content/uploads/2024/11/AMA-2024-Advocacy-Epidemic-report-opioidprescriptions-IQVIA_FINAL.pdf AMA 2024 Overdose Report IQVIA Data Naloxone: https://end-overdose-epidemic.org/wpcontent/uploads/2024/11/AMA-Advocacy-Epidemic-report-naloxone-IQVIA_FINAL.pdf