Test For Correlation In R.
These are the two variables that you want to correlate in the Pearson correlation. The value of the test statistic t is shown in the computer or calculator output along with the p -value. It can be noted that cor computes the correlation coefficient whereas cortest computes test for.
This needs to be tested with a hypothesis testand known as the correlation test.
Import your data into R. Preliminary test to check the test assumptions. Visualize your data using scatter plots. The test statistic t has the same sign as the correlation coefficient r.