I understand that linear regression is finding the "best fitting line" and Pearson's r is measuring correlation between two variables, but I can't visualize this difference.
I had a project where I was finding if certain brain cancers were correlated to age, or sex for example, and I was advised to use linear regression for this, but from the definition above, in my head it sounds like Pearson's r was what I was looking for?
Can someone clarify this difference?