Let me be honest and say that it is pretty unlikely
that you will be calculating too many correlations by hand.
However, doing an example by hand is a great way to really understand correlation.
I would recommend working through this example first and then using SPSS or other statistics software in the future.
We will begin with the assumptions and the necessary settings for null hypothesis testing using correlation,
then I will show you a simple example of using the correlation formula. This will get you acquainted with the procedure,
and then we will learn how to do it with the statistics software.
Pearson's Correlation is used to assess the strength and the direction of a relationship between two variables.
Here is what you need to know in order to use it.
The independent and dependent variables.
There's not necessarily an IV and a DV, but you will use one variable, the one on the x-axis,
to predict the other variable, the one on the y-axis.
So as such, the variables would be similar to an independent variable predicting a dependent variable.
Both variables must be quantitative at the scale level and continuous.
You should not have any extreme outliers.
Check for outliers using the explorer command in SPSS.
Delete or winsorize severe outliers
so that the outlier is the same as the next highest non-outlier value in the data set.
Both of the variables should be normally distributed.
Now the actual assumption of correlation is bivariate
normality, however, bivariate normality is rather difficult to assess.
So instead use a Shapiro-Wilk test for univariate normality on both variables.
There should be a linear relationship between the two variables in the correlation.
You can confirm this by using a scatterplot.
This is not truly an assumption, however, because the whole point of Pearson's test is to determine
if there is a linear relationship between the two variables,
but when you look at the scatterplot
you will see if the scatter plot is not linear. For example,
If it curves or it's cone-shaped, and if so, then you would use the nonparametric
Spearman's Rho correlation, or you could transform the data.
Now, let me quickly add if any of these assumptions are violated you cannot use Pearson's correlation,
but you still have options.
If one variable is dichotomous,
Coded 0 and 1, you can use a biserial or a point biserial correlation.
This is exactly the same procedure. The name depends upon whether the dichotomous variable is ordered or not.
Now, if the data are ordinal, or if you cannot remove the outliers, or if the data are not linearly related
you can use Spearman's rank order correlation, and this is a nonparametric
correlation. If your data set is small and/or it has a lot of tied ranks use
Kendall's Tau correlation,
this is also nonparametric.
And if you want to examine the relationship between x and y while controlling for the influence of a third variable,
then you would use partial correlation.
All of these alternatives are covered in other videos,
especially the video about nonparametric correlation.
You can use a correlation for hypothesis testing or you can determine if a particular correlation is
statistically significant.
If you want to test for significance, here's what you need to know.
The null hypothesis is that the variables are unrelated.
Therefore, the correlation in the population is 0.
The Greek letter for r is rho,
so the null hypothesis for a two-tailed test would be h-sub 0: rho = 0.
The correlation in the population is 0. The alternative hypothesis would be
rho does not equal 0.
Now you can do a one-tailed hypothesis test with correlation, but typically correlations are treated as two-tailed tests.
If you did a one-tailed test, then the alternative hypothesis would be something like h-sub 1: Rho > 0,
Rho is greater than 0. And the null hypothesis would be Rho <= 0.
But that kind of setup would only be used if the direction of the correlation was particularly important
The alpha level is going to be set to 0.05, but it can be 0.01, or any other level
chosen by the researcher.
When you compute a correlation by hand you can also do a t-test to determine if the correlation is
statistically significantly different than zero, and I will show you that test here.
When conducting the t-test for determining if a correlation is significant use the degrees of freedom n-2,
where n equals the number of pairs of scores.
The critical value is determined using Student's t distribution table.
Based on the degrees of freedom and alpha just as we did for a one-sample t-test, and as always,
assume that the correlation is an alpha = .05 two-tailed test,
unless you're told otherwise.
And so, with that let's calculate a correlation by hand.
Now you have heard that an apple a day keeps the doctor away,
so you conduct a simple survey to ask 10 people how many apples they eat per day, and
how many times they have visited a physician in the last year.
So let's take a look at the data.
The subject variable is a random participant identification number. It's not used for analysis,
just helps us keep track of the responses from the 10 participants.
X is the number of apples eaten per day which predicts y, the number of doctor visits.
You can see that there are three columns that we will need to create.
X-squared
Y-squared, and XY, and of course we will need the sums of each of these columns.
So we will begin by squaring the x-values. Take each x-value,
square it, and then add it to the x-squared column.
Now we're ready to do the y-squared values using the same procedure. We would create the y-squared column, and
finally we would multiply each x-value by its corresponding y-value, always working across rows, and
therefore create the XY column or the X*Y column..
Now that we have each of these columns completed, we should add up each one.
This gives us the sum of each column, and the N of 10 for the number of pairs of scores.
I will transfer these values to the next slide and show you the formula. Now, first of all, don't get frightened.
I know this can be a scary looking formula.
There are lots of sharp angles and points where you could get yourself hurt, but don't worry.
We are going to plug in numbers the same way that we always have in the past. You can do this.
We start by plugging in the sums that we calculated to the parts of the formula where those sums would go.
N is 10. The sum of x times y is 52, and so on.
Now once we have those numbers plugged in, we use the PEMDAS
to begin solving the equation. Parentheses, exponents
multiplication, division ,addition subtraction.
We do the multiplication for both the numerator and the denominator, and now we're ready to do some subtraction.
Notice the -279 in the numerator.
That tells us that the relationship between the variables is going to be negative.
Finally, we take the square root of the denominator and divide
so that our correlation between x and y is a -.945.
We will round that to a -.95.
But is this correlation
statistically significant? To know for sure, we will use a t-test.
This is the formula by which we can calculate a t-value from an t-value.
You will notice that all you need is r and n.
We start by plugging in values,
squaring r, and setting up our formula.
then we do some subtraction in the denominator, and then some division, and the square root, and
finally we solve for t.
Now here I dropped the negative sign because
we interpret a negative t-value the same way as a positive t-value so we can now summarize this as
t with eight degrees of freedom is 8.17
Remember, that we had 10 pairs of scores and the degrees of freedom is n - 2, where n is the number of pairs.
So the degrees of freedom = 8.
We go to the t-table, the back of our notes for t-tests,
and we look up the critical value for a t-test with 8 degrees of freedom.
We discover that the critical value is
2.31, our t-value of 8.17
exceeds this critical value of 2.31, so this correlation is
statistically significantly different than 0. p < .05, and
here is how we could write up the results,
"A Pearson product-moment correlation test revealed that apples per day and annual doctor visits were strongly inversely related,
r(8) = -.95, p < .05;
increases in apple consumption were accompanied by decreases in physician visits there for
90% of the variance in obtained medical services was explained by apple consumption."
You would not say that eating apples caused fewer doctor visits, and as I said at the beginning,
we typically do not calculate
correlation by hand, but this exercise will help you understand much better what we are doing
next time we calculate correlation using SPSS.