Technology
Understanding Positive and Negative Correlations: Practical Examples
Understanding Positive and Negative Correlations: Practical Examples
Correlation is a statistical measure that indicates the extent to which two or more variables fluctuate in relation to each other. This article will explore positive correlation and negative correlation with practical examples and demonstrate how to use R software to calculate these relationships.
Positive Correlation: Two Variables That Increase Together
A positive correlation exists when one variable increases as another variable increases. A classic example is the relationship between a person's height and weight. As a person's height increases, their weight tends to increase as well. Another example can be seen in the relationship between highway miles per gallon (mpg) and city miles per gallon from the mpg dataset. Intuitively, we suspect that highway mpg is generally higher than city mpg due to differences in driving conditions.
Calculating Positive Correlation with R
To calculate the Pearson correlation between highway mpg and city mpg, you can use the following R code:
cor(mpg$highway, mpg$city)
Executing this R code confirms that the correlation is not equal to 0 at the 0.01 and 0.05 significance levels, indicating a positive correlation.
Negative Correlation: One Variable Increases while Another Decreases
A negative correlation exists when one variable increases as another variable decreases. This relationship can be observed in the price of a product and the quantity demanded. As the price of a product increases, the quantity demanded decreases. Another practical example can be seen with the relationship between engine displacement and highway miles per gallon (mpg). Intuitively, as engine size increases, highway mpg tends to decrease.
Calculating Negative Correlation with R
To confirm the negative correlation between engine displacement and highway mpg, you can use the following R code:
cor(mpg$displ, mpg$highway)
The result will show a significant negative correlation, indicating that as engine displacement increases, highway mpg decreases.
Additional Practical Examples of Correlation
Let's explore some more practical examples of correlation:
Correlation of Meeting Attendance with COVID Incidence
The number of people meeting in a confined area can significantly correlate with the realized COVID incidence in the next three weeks for that group of people. For instance, in a hypothetical scenario, if a large number of people meet in a closed venue, the likelihood of spreading COVID-19 increases, leading to a higher incidence in the following weeks.
Negative Correlation of Ivermectin Use and COVID Incidence
A correlation can also exist in medical contexts, such as the number of people taking ivermectin three days before a meeting. In this case, taking ivermectin can potentially reduce the risk of contracting or spreading the virus, leading to a negative correlation with the realized COVID incidence in the next three weeks.
Conclusion
Understanding positive and negative correlations is crucial for data analysis and decision-making in various fields, from economics to public health. The practical examples provided in this article demonstrate how to measure these relationships using R software, which offers powerful tools for statistical analysis.
References
EPA FuelEconomy.gov. (2022). Official U.S. government source for fuel economy information. https://www.fueleconomy.gov/feg/default.jsp