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

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

1 Expert Approved Answer
Step: 1 Unlock

R c... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!