[advice_space large_desktop_space=”156″ desktop_space=”156″ tablet_space=”100″ landscape_mobile_space=”100″ mobile_space=”100″][advice_heading font_weight=”800″ color=”custom” title=”How to Perform Pearson
Correlation in R” custom_color=”#ffffff”][advice_space large_desktop_space=”5″ desktop_space=”5″ tablet_space=”5″ landscape_mobile_space=”10″ mobile_space=”10″][advice_text_block font_weight=”400″ color=”custom” custom_color=”#ffffff” css=”.vc_custom_1666770851538{margin-top: 10px !important;}”]

Looking for a Pearson Correlation in R? Doing it yourself is always cheaper, but it can also be a lot more time-consuming. If you’re not good at R programming, you can pay someone to do your R task for you.

[/advice_text_block][advice_space large_desktop_space=”5″ desktop_space=”5″ tablet_space=”5″ landscape_mobile_space=”10″ mobile_space=”10″][advice_button align=”left” shape=”rounded” text=”Get a FREE Quote Now!” link=”url:http%3A%2F%2Fwww.staging.onlinespss.com%2Fsubmit-your-project%2F|title:Submit%20Your%20Statistics%20Project-Homework-Assignment||”][advice_space large_desktop_space=”5″ desktop_space=”5″ tablet_space=”5″ landscape_mobile_space=”10″ mobile_space=”10″]

[advice_space large_desktop_space=”156″ desktop_space=”156″ tablet_space=”100″ landscape_mobile_space=”100″ mobile_space=”100″]
[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]
[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]

What is a Pearson Correlation Analysis?

Correlation describes the strength and direction of the linear relationship between two variables. Pearson’s correlation coefficient is used for interval variables, and Pearson’s correlation coefficient can only take values from -1 to +1. The sign indicates whether the correlation is positive (both variables decrease or increase) or negative (one variable decreases when the other increases and vice versa). A perfect correlation, 1 or -1, indicates that the value of one variable can be accurately determined when we know the value of the other. A correlation equal to 0 indicates no relationship between the two variables.

When Should a Pearson Correlation be Used?

Pearson’s correlation coefficient is the test statistic that measures the statistical relationship, or association, between two continuous variables. So, you should use the Pearson correlation coefficient when (1) the relationship is linear and (2) both variables are quantitative and (3) normally distributed, and (4) have no outliers.

An Example Of Pearson Correlation Test

For example, a teacher wants to examine the relationship between the level of anxiety and the exam score. Then we have two variables: the level of anxiety and the exam score.

Therefore, we test the following hypotheses:

Null hypothesis: There is no significant effect relationship between the level of anxiety and exam score.

Alternative hypothesis: There is a significant effect relationship between the level of anxiety and exam score

R function to Compute Pearson Correlation

The code to run a Pearson Correlation Analysis using R is as follows:

cor.test (x, y, method=(“pearson”, “kendall”, “spearman”), data = dataframe)

x, y: numeric vectors with the same length

method: correlation method

[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]
[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]
[advice_heading tag=”h2″ title=”Running Pearson Correlation in Rstudio” css=”.vc_custom_1666773139498{margin-bottom: 24px !important;}”][advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]

In this section, we will show you how to run the Pearson correlation analysis using the r studio program and how to interpret the test results after we obtain the result of the test. In the first part, we present the r program code and function for the correlation analysis. Next, you will see the outputs as a result of running the r codes. In the last section, you can find the interpretation of the Pearson correlation in APA format.

# LOAD DATA
library(readxl)
Data <- read_excel(“Data.xlsx“)
# VIEW DATA
View(Data)
# NAME VARIABLES
data <- Data
anxiety <- data$anxiety
exams <- data$exams
# PERFORM PEARSON CORRELATION ANALYSIS
cor.test(anxiety, exams, method=c(“pearson”))

# SCATTERPLOT 
plot(anxiety, exams, main=”Scatter plot”, xlab=”Anxiety level”, ylab=”Exam score”, pch=19)
abline(lm(exams~anxiety), col=”black”)

> cor.test(anxiety, exams, method=c("pearson"))
## 
##  Pearson's product-moment correlation
## 
## data:  anxiety and exams
## t = 1.5724, df = 97, p-value = 0.1191
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  -0.0410285  0.3443544
## sample estimates:
##       cor 
## 0.1576603

> plot(anxiety, exams, main="Scatter plot", xlab="Anxiety level", ylab="Exam score", pch=19)
> abline(lm(exams~anxiety), col="black")



Reporting Pearson Correlation in R

Pearson correlation coefficient was computed to determine the relationship between anxiety level and exam score. The results indicate a non-significant negative weak relationship, r(97) = 0.16, p = 0.12. We, therefore, fail to reject the null hypothesis and conclude that there is no significant relationship between anxiety level and exam score.

[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]
[advice_space large_desktop_space=”25″ desktop_space=”25″ tablet_space=”25″ landscape_mobile_space=”25″ mobile_space=”25″]
[advice_heading tag=”h2″ text_align=”center” color=”custom” title=”Are you in trouble with RStudio?” custom_color=”#ffffff” css=”.vc_custom_1666632875184{margin-bottom: 39px !important;}”]
[advice_button align=”center” shape=”” size=”large” i_type=”adviceicons” i_icon_adviceicons=”ai ai-analysis-table” add_icon=”true” text=”GET HELP NOW!” link=”url:http%3A%2F%2Fwww.staging.onlinespss.com%2Fsubmit-your-project%2F|title:Submit%20Your%20R%20Studio%20Task||” css=”.vc_custom_1666632922231{margin-bottom: 30px !important;}”]
[advice_space landscape_mobile_space=”28″ mobile_space=”28″]

GET HELP FROM US

There is a lot of statistical software out there, but R is one of the most popular. If you’re a student who needs help with R Studio, there are a few different resources you can turn to. We prepared a page for R tutorial for Beginners. All contents can guide you through Step-by-step R data analysis tutorials and you can see Basic Statistical Analysis Using the R Statistical Package.

The second option is that you can get help from us, we give R Studio help for students with their assignments, dissertation, or research. Doing it yourself is always cheaper, but it can also be a lot more time-consuming. If you’re not the best at SPSS, then this might not be a good idea. It can take days just to figure out how to do some of the easier things in SPSS. So paying someone to do your R task will save you a ton of time and make your life a lot easier.

The procedure of the R help service at OnlineSPSS.com is fairly simple. There are three easy-to-follow steps.

1. Click and Get a FREE Quote
2. Make the Payment
3. Get the Solution

Our purpose is to provide quick, reliable, and understandable information about Rstudio data analysis to our clients.