Question: Write a function PearsonCor, which input is a data frame with two numerical columns. It calculates the Pearson correlation coefficient inside and returns a
Write a function PearsonCor, which input is a data frame with two numerical columns. It calculates the Pearson correlation coefficient inside and returns a single value (don't use built in cor function). Round your answer to 3 digits. Sample input mtcars $mpg, mtcars $hp Sample output -0.776
Step by Step Solution
There are 3 Steps involved in it
R c... View full answer
Get step-by-step solutions from verified subject matter experts
