IBM Support

Confidence intervals for correlations

Troubleshooting


Problem

Does SPSS compute confidence intervals (CIs) on various correlation coefficients (Pearson, Kendall tau, phi) ?

Resolving The Problem

SPSS does not directly provide confidence intervals for any of the measures of correlation or association that it prints. The Tau-b and Tau-C statistics from CROSSTABS include the "Asymp. Std. Error" or asymptotic standard error. As the footnote for this statistic indicates, it does not assume the null hypothesis and would be the appropriate standard error (SE) to calculate a confidence interval for the tau statistic in question.

The CORRELATIONS procedure also does not print confidence intervals. A set of SPSS commands is provided at the end of this resolution These commands transform a correlation to a Fisher Z, calculate the Standard Error of that Z, calculate the confidence interval for the Z, and then translate the upper and lower bounds for Z back to correlations. The user inputs the correlation, the sample size, and the desired confidence level. The command syntax below includes a DATA LIST command to read input data from 3 text book examples of the calculation of CIs for correlations. Two examples are taken from Glass & Hopkins (1984) and one example from Snedecor & Cochran (1980). The formulas were taken from Snedecor & Cochran. The commands reproduce the text results for all 3 examples.

Glass, G.V., & Hopkins, K.D. (1984). Statistical Methods in Education and Psychology (2nd Ed.). Englewood Cliffs NJ: Prentice-Hall.

Snedecor, G.W., & Cochran, W.G. (1980). Statistical Methods (7th Ed.). Ames IA: Iowa State University Press.

************************.
* Read in example r, n, and confidence levels from texts.
data list free / r n conflev .
begin data .
.83 30 .95
.93 83 .95
-.889 9 .99
end data.

* compute and list lower and upper confidence bounds for correlation coefficient .
* Correlation R, Sample size N, and confidence level CONFLEV (expressed as proportion)
* are entered by user directly into data set.
* SEZ is computed as the standard error of the Fisher Z, which only depends on N .
* CRITZ is is the critical value of a standard normal variable corresponding to
* the desired confidence level, leaving (1 - conflev)/2 in each tail.
* For CONFLEV = .95, CRITZ = 1.96 .

* Translate r to Fisher Z , fz .
compute fz = .5*ln((1+r)/(1-r)).
compute sez = 1/sqrt(n-3).
compute critz = abs(idf.normal((1 - conflev)/2,0,1)).
* compute lower and upper bounds for fz .
compute lo_fz = fz - critz*sez .
compute hi_fz = fz + critz*sez .
* translate upper and lower bounds of fz back to correlations .
compute lo_r = (exp(2*lo_fz) - 1)/(exp(2*lo_fz) + 1).
compute hi_r = (exp(2*hi_fz) - 1)/(exp(2*hi_fz) + 1).
formats r conflev to hi_r (f10.4) / n (f8).
list r n conflev lo_r hi_r .
*******************.

All of the steps in the commands above can be performed in the graphical user interface of SPSS, rather than through the commands. The variable r, n, and conflev can be created in the data editor and the data entered directly. The Compute command is available in the menu system from
Transform->Compute. The new variable name is entered in the Target box and the right side of the equation, i.e. the formula in each command, is typed into the "Numerical Expression" box of the Compute dialog.

Note that the commands assume that the desired confidence level, CONFLEV, is entered as a proportion. If you prefer to enter CONFLEV as a percentage, you would need to change the command:

compute critz = abs(idf.normal((1 - conflev)/2,0,1)).

to

compute critz = abs(idf.normal((1 - conflev/100)/2,0,1)).

Altman and Gardner (2000, p. 90-91) argue that the Fisher Z methods for computing confidence intervals for Pearson correlations can also be applied to Spearman Rank correlations as the distributions of the two correlations are similar. Spearman Rank correlations are Pearson correlations of the rank scores. You would simply read the Spearman Rank correlation in as r in the commands above. The phi coefficient also produces the same result as the Pearson correlation of the 2 binary variables. You may want to get additional opinions on using Fisher Zs for phi.

Altman, D.G., & Gardner, M.J. (2000). Regression and Correlation. in D.G. Altman, D. Machin, T.N. Bryant, & M.J. Gardner (Eds.). Statistics With Confidence (2nd Ed.). BMJ Books.

[{"Product":{"code":"SSLVMB","label":"IBM SPSS Statistics"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Not Applicable","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Historical Number

70872

Document Information

Modified date:
16 April 2020

UID

swg21478368