Monday, April 9, 2018

(R) Partial Correlation (SPSS)

In previous articles, the topic of Pearson Correlation was discussed. In this entry, we will discuss a different aspect pertaining to the subject, Partial Correlation.

Partial Correlation refers to a method which is utilized to measure the correlation between two variables, while also controlling for a third variable. This method of correlation measurement can produce, in certain cases, a more accurate correlation figure.

So, for example, if we were presented with the following data vectors, and we wished to create a partial correlation, we would proceed by utilizing the code below:

(This example requires that the R package: “ppcor”, be downloaded and enabled.)

# Data Vectors #

x <- c(8, 1, 4, 10, 8, 10, 3, 1, 1, 2)
y <- c(97, 56, 97, 68, 94, 66, 81, 76, 86, 69)
z <- c(188, 184, 181, 194, 190, 180, 192, 184, 192, 191)

# To perform the necessary analysis #

pcor.test(x, y, z)


This produces the following output:

  estimate p.value statistic n gp Method
1 0.1283774 0.7420369 0.3424887 10 1 pearson


In the case of our example, the correlation of the variables “x” and “y” is being assessed, with “z” being accounted for as the control variable.

estimate – This figure represents the r-value of the output.

statistic – This figure represents the t-value of the output.

p.value – This figure represents the p-value of the output.

n – This figure is the number of observations contained within the test set.

Method – This is the correlation method that was utilized to generate the output.

The “estimate” value is the correlation figure. It is this value, and value labeled “p.value”, which we will primarily concern ourselves with. “Estimate”, is a measurement of the strength of the correlation, while “p.value”, measures the strength of the model. Typically, if models are being compared for accuracy, the model which possesses the lower “p.value” should be utilized.

If we are reporting our results in APA format, we must also perform a standard Pearson Correlation. For more information as to how to interpret this model, please consult prior articles pertaining to the subject matter.

# Pearson Correlation #

cor.test(x, y)

This produces the output:

Pearson's product-moment correlation

data: x and y
t = 0.36656, df = 8, p-value = 0.7235
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
-0.5452231 0.7013920
sample estimates:
       cor
0.1285237


t - This figure represents the t-value of the output.

df – This figure represents the degrees of freedom of the model.

p-value - This figure represents the p-value of the output.

cor - This figure represents the r-value of the output.

To report the findings found within these output figures, we would write the following conclusion:

A partial correlation was utilized to evaluate the null hypothesis that there is no significant relationship between variable “x” and variable “y” (N=10). There was weak partial correlation between variable “x” (M = 4.8, SD = 3.79) and variable “y” (M = 79, SD = 14.35(, controlling for variable “z”, r(7)* = .13, p = .74. Results of the zero order correlation yielded that there was a weak correlation between “x” and “y”, r(8) = .13, p = .72, indicating that controlling for variable “z” had little effect on the strength of the relationship between two variables.

* Equals the number of observations minus the number of variable categories.

If we were to perform this same analysis in SPSS, the steps would resemble:

Example (SPSS)

Let’s begin with our sample data set:


From the top most menu, select “Analyze”, then select “Correlate”, followed by “Bivariate”.

This should cause the following menu to populate:


Through the utilization of the arrow button located in the center of the interface, designate “X” and “Y” as the model variables.

When you have completed this step, click “OK”.

This produces the output screen:


With the Pearson Correlation completed, we will now generate a partial correlation model.


From the top most menu, select “Analyze”, then select “Correlate”, followed by “Partial”.

This will cause the following menu to appear:


Through the utilization of the top central arrow button, designate “X” and “Y” as the model variables. 

Once this has been completed, utilize the bottom arrow button to designate “Z” as the control variable.

When finished, click “OK”.

This should generate the output screen:


With both output sections generated, you should now be prepared to complete your written summary.

That’s all for now. Stay inquisitive, Data Heads!

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.