inst/shiny-apps/correlation/correlation_help.md

Correlation measures the strength of linear association between two numeric variables. It ranges in value from -1 to 1. Drag the slider to visualize different correlations between x and y. Click New Sample to generate new data at a specified correlation strength.

The correlation coefficient is calculated by:

$$r_{xy} = \frac{\text{Cov}(x,y)}{\text{SD}_x\text{SD}_y}$$

where $\text{Cov}$ is covariance and $\text{SD}$ is standard deviation. This is known as Pearson's correlation.

This can be calculated in R as cov(x, y)/(sd(x) * sd(y)) or simply cor(x, y).



clayford/consultr documentation built on Aug. 5, 2021, 7:29 p.m.