16.6 C
London
Friday, July 5, 2024
HomeRDescriptive Statistics in RHow to Calculate Point-Biserial Correlation in R

How to Calculate Point-Biserial Correlation in R

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

Point-biserial correlation is used to measure the relationship between a binary variable, x, and a continuous variable, y.

Similar to the Pearson correlation coefficient, the point-biserial correlation coefficient takes on a value between -1 and 1 where:

  • -1 indicates a perfectly negative correlation between two variables
  • 0 indicates no correlation between two variables
  • 1 indicates a perfectly positive correlation between two variables

This tutorial explains how to calculate the point-biserial correlation between two variables in R.

Example: Point-Biserial Correlation in R

Suppose we have a binary variable, x, and a continuous variable, y:

x 

We can use the built-in R function cor.test() to calculate the point-biserial correlation between the two variables:

#calculate point-biserial correlation
cor.test(x, y)

	Pearson's product-moment correlation

data:  x and y
t = 0.67064, df = 9, p-value = 0.5193

alternative hypothesis: true correlation is not equal to 0

95 percent confidence interval:
 -0.4391885  0.7233704

sample estimates:
      cor 
0.2181635 

From the output we can observe the following:

  • The point-biserial correlation coefficient is 0.218
  • The corresponding p-value is 0.5193

Since the correlation coefficient is positive, this indicates that when the variable x takes on the value “1” that the variable y tends to take on higher values compared to when the variable x takes on the value “0.”

However, since the p-value of this correlation is not less than .05, this correlation is not statistically significant. 

Note that the output also provides a 95% confidence interval for the true correlation coefficient, which turns out to be:

95% C.I. = (-0.439, 0.723)

Since this confidence interval contains zero, this is further evidence that the correlation coefficient is not statistically significant. 

Note: You can find the complete documentation for the cor.test() function here.

Additional Resources

The following tutorials explain how to calculate other correlation coefficients in R:

How to Calculate Partial Correlation in R
How to Calculate Rolling Correlation in R
How to Calculate Spearman Rank Correlation in R
How to Calculate Polychoric Correlation in R

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories