# Relationship between correlation coefficient and regression

### Difference Between Correlation and Regression in Statistics - Data Science Central

In correlation analysis, we estimate a sample correlation coefficient, more A correlation close to zero suggests no linear association between. The degree of association is measured by a correlation coefficient, denoted by r. Complete correlation between two variables is expressed by either + 1 or Correlation is a measure of association between two variables. When calculating a correlation coefficient for ordinal data, select Spearman's technique.

Graphical displays are particularly useful to explore associations between variables. The figure below shows four hypothetical scenarios in which one continuous variable is plotted along the X-axis and the other along the Y-axis. Scenario 3 might depict the lack of association r approximately 0 between the extent of media exposure in adolescence and age at which adolescents initiate sexual activity. Example - Correlation of Gestational Age and Birth Weight A small study is conducted involving 17 infants to investigate the association between gestational age at birth, measured in weeks, and birth weight, measured in grams.

We wish to estimate the association between gestational age and infant birth weight. In this example, birth weight is the dependent variable and gestational age is the independent variable. The data are displayed in a scatter diagram in the figure below.

Each point represents an x,y pair in this case the gestational age, measured in weeks, and the birth weight, measured in grams. Note that the independent variable is on the horizontal axis or X-axisand the dependent variable is on the vertical axis or Y-axis. The scatter plot shows a positive or direct association between gestational age and birth weight. Infants with shorter gestational ages are more likely to be born with lower weights and infants with longer gestational ages are more likely to be born with higher weights.

The formula for the sample correlation coefficient is where Cov x,y is the covariance of x and y defined as are the sample variances of x and y, defined as The variances of x and y measure the variability of the x scores and y scores around their respective sample meansconsidered separately.

The covariance measures the variability of the x,y pairs around the mean of x and mean of y, considered simultaneously.

### Difference Between Correlation and Regression (with Comparison Chart) - Key Differences

To compute the sample correlation coefficient, we need to compute the variance of gestational age, the variance of birth weight and also the covariance of gestational age and birth weight. We first summarize the gestational age data. The mean gestational age is: Linear regression is usually used when X is a variable you manipulate time, concentration, etc. Does it matter which variable is X and which is Y?

With correlation, you don't have to think about cause and effect. It doesn't matter which of the two variables you call "X" and which you call "Y". You'll get the same correlation coefficient if you swap the two. The decision of which variable you call "X" and which you call "Y" matters in regression, as you'll get a different best-fit line if you swap the two.

The line that best predicts Y from X is not the same as the line that predicts X from Y however both those lines have the same value for R2 Assumptions The correlation coefficient itself is simply a way to describe how two variables vary together, so it can be computed and interpreted for any two variables. Further inferences, however, require an additional assumption -- that both X and Y are measured, and both are sampled from Gaussian distributions.

## Difference Between Correlation and Regression

This is called a bivariate Gaussian distribution. If those assumptions are true, then you can interpret the confidence interval of r and the P value testing the null hypothesis that there really is no correlation between the two variables and any correlation you observed is a consequence of random sampling.

The ease of waking up in the morning often depends on how late you went to bed the night before. Quantitative regression adds precision by developing a mathematical formula that can be used for predictive purposes. For example, a medical researcher might want to use body weight independent variable to predict the most appropriate dose for a new drug dependent variable.

The purpose of running the regression is to find a formula that fits the relationship between the two variables. Then you can use that formula to predict values for the dependent variable when only the independent variable is known.

A doctor could prescribe the proper dose based on a person's body weight. The regression line known as the least squares line is a plot of the expected value of the dependent variable for all values of the independent variable.