11
11: Calculating the Pearson Correlation Coefficient with Excel We start by entering the data of the exams scores of the 10 firstyear psychology students (Book p 283). The first column shows the scores on the Stats exam; the second those of the Social Psychology exam. Although it is tempting to build the complete auxiliary table with the various equations (please, feel free to do so!), we’ll limit ourselves to the builtin function to calculate Pearson productmoment correlations. Marc Brysbaert www.palgrave.com/psychology/brysbaert Basic Statistics for Psychologists 11: Calculating the Pearson Correlation Coefficient with Excel Palgrave, 2011 1

Excel Solution for Correlation Cofficient

Embed Size (px)

DESCRIPTION

Excel

Citation preview

Page 1: Excel Solution for Correlation Cofficient

11: Calculating the Pearson Correlation Coefficient with Excel 

 

We start by 

entering the 

data of the 

exams scores of 

the 10 first‐year 

psychology 

students (Book p 

283). The first 

column shows 

the scores on 

the Stats exam; 

the second 

those of the 

Social 

Psychology 

exam. 

 

 

Although it is tempting to build the complete auxiliary table with the various equations (please, feel free to do so!), we’ll 

limit ourselves to the built‐in function to calculate Pearson product‐moment correlations. 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      1 

 

Page 2: Excel Solution for Correlation Cofficient

Activate Cell E1 

(or whichever 

cell in which you 

want to have 

your 

correlation). 

Click on fx to 

open the 

function panel of 

Excel: 

 

 

 

Select the 

function CORREL 

from the 

Statistical 

functions. Click 

on OK. 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      2 

 

Page 3: Excel Solution for Correlation Cofficient

Enter A1:A10 in 

the first entry 

box and B1:B10 

in the second 

(tip: you can 

easily do this by 

putting your 

cursor in the 

entry box and 

then going with 

the mouse over 

the cells while 

keeping the left 

key pressed). 

Then click OK. 

This gives you 

the correlation 

value of .4508 

(check with the 

solution on p. 

284 of the book) 

 

To calculate the intercept and the regression weight of the regression line, we can again make use of the formulas 

described in the book or make use of the built‐in Excel functions. We demonstrate the latter (please, feel free to make your 

own file with all the relevant information!). 

Select the 

function 

INTERCEPT from 

the Statistical 

library. 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      3 

 

Page 4: Excel Solution for Correlation Cofficient

Enter B1:B10 in 

the box asking 

for known_y’s 

(the values that 

have to be 

predicted) and 

A1:A10 in the 

box asking for 

known_x’s (the 

values that are 

used as 

predictors). 

Then click on OK 

 

 

 

This gives you 

the value of the 

intercept: 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      4 

 

Page 5: Excel Solution for Correlation Cofficient

To find the value 

of the slope of 

the regression 

line, use the 

function SLOPE 

 

 

 

This gives you 

the required 

value (cf. p 284): 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      5 

 

Page 6: Excel Solution for Correlation Cofficient

In addition, we 

may want to 

have a scatter 

plot of the data. 

For this, go with 

the cursor to Cell 

E7 (or so) and 

click on Insert 

and Scatter: 

 

 

 

Choose the 

scatter plot: 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      6 

 

Page 7: Excel Solution for Correlation Cofficient

Click on Select 

Data. 

 

 

 

Activate all 

numbers both in 

column A and B 

by going over 

them with the 

mouse (left 

button pressed 

in). Start in Cell 

A1 and go to Cell 

B10. Then click 

on OK: 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      7 

 

Page 8: Excel Solution for Correlation Cofficient

This gives you 

the desired plot, 

even though the 

values on the 

axis may not be 

optimal: 

 

 

 

To change this 

activate the axis 

you want to 

change by left 

clicking on it. 

Then click on the 

right mouse 

button to see 

the following 

panel: 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      8 

 

Page 9: Excel Solution for Correlation Cofficient

Select Format 

Axis and adjust 

the minimum 

and maximum 

value to desired 

values: 

 

 

 

Then do the 

same for the Y‐

axis: 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      9 

 

Page 10: Excel Solution for Correlation Cofficient

Which will give 

you the 

following 

picture, in which 

you can then 

add axis labels, 

titles, etc… 

 

 

You can also try 

out different 

Chart Layouts. 

To add the 

regression line, 

activate the dots 

of the scatter 

plot by clicking 

on one of them. 

Then click on the 

right mouse 

button to get 

the following 

panel, from 

which you select 

Add Trendline. 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      10 

 

Page 11: Excel Solution for Correlation Cofficient

 

 

 

With a bit of 

editing you may 

get something as 

follows: 

 

 

 

            Marc Brysbaert                                                                                         www.palgrave.com/psychology/brysbaert  

Basic Statistics for Psychologists                                                                  11: Calculating the Pearson Correlation Coefficient with Excel 

Palgrave, 2011      11