- Correlation measures how two variables are linearly related
- It can be used to demonstrate simple relationships between certain variables
- While it can be helpful in demonstrating simple relationships, correlation does not always imply causation
2024-02-04
As stated before, correlation does not always imply causation! However, correlation can be helpful to healthcare providers and researchers. By finding which variables have a linear relationship, healthcare providers can make decisions on who may or may not need more attention to decrease bad outcomes. For example, if the data shows that there is a positive correlation between heart attacks and smoking, a doctor might recommend their smoking patient with some artery blockage to quit smoking. This is not to say that smoking would be the reason this patient could have a heart attack. Simply, quitting smoking could decrease the chance of a cardiovascular incident.
Finding covariance is the first step in finding correlation coefficient. It measures how the two variables change in relationship to each other.
Population: \(Cov(x,y) = \frac{\sum(X_{i}-\bar{X})(Y_{i}-\bar{Y})}{n}\)
Sample: \(Cov(x,y) = \frac{\sum(x_{i}-\bar{x})(y_{i}-\bar{y})}{n-1}\)
Once covariance is determined, the correlation coefficient can be found using the formula: \(Cor(x,y) = \frac{Cov(x,y)}{s_{x}s_{y}}\)
hd$age <- hd$age / 365 xax <- list( title = "Weight", titlefont = list(family="Modern Computer Roman") ) yax <- list( title = "Age", titlefont = list(family="Modern Computer Roman") ) fig1 <- plot_ly(hd,x=~weight,y=~age,type="scatter",mode="markers",width=400,height=400)%>% layout(xaxis=xax,yaxis=yax) config(fig1)
By using the covariance and correlation coefficient formulas, it is possible to determine if two variables have a linear relationship. Hard conclusions should never be determined from correlation alone, but used in conjunction with other data, it can help healthcare providers recommend courses of action to their patients that may mitigate unlikely health outcomes.