How Coding affects Correlation Coefficient, Line of Best Fit

How does coding the data change the correlation coefficient? When does the slope of the best fit line change?