Many biostatistical analyses are conducted to study the relationship between two continuous or ordinal scale variables within a group of patients.
Purposes of these analyses include:
This lesson will focus only on correlation and agreement, (issues numbered 1 and 2 listed above).
Upon completion of this lesson, you should be able to do the following:
Correlation is a general method of analysis useful when studying possible association between two continuous or ordinal scale variables. Several measures of correlation exist. The appropriate type for a particular situation depends on the distribution and measurement scale of the data. Three measures of correlation are commonly applied in biostatistics and these will be discussed below.
Suppose that we have two variables of interest, denoted as X and Y, and suppose that we have a bivariate sample of size n:
(X_{1} , Y_{1} ), (X_{2} , Y_{2} ), ... , (X_{n} , Y_{n} )
and we define the following statistics:
\[\bar{X}=\frac{1}{n}\sum_{i=1}^{n}X_i , S_{XX}=\frac{1}{n1}\sum_{i=1}^{n}(X_i\bar{X})^2\]
\[\bar{Y}=\frac{1}{n}\sum_{i=1}^{n}Y_i , S_{YY}=\frac{1}{n1}\sum_{i=1}^{n}(Y_i\bar{Y})^2\]
\[S_{XY}=\frac{1}{n1}\sum_{i=1}^{n}(X_i\bar{X})(Y_i\bar{Y})\]
These statistics above represent the sample mean for X, the sample variance for X, the sample mean for Y, the sample variance for Y, and the sample covariance between X and Y, respectively. These should be very familiar to you.
The sample Pearson correlation coefficient (also called the sample productmoment correlation coefficient) for measuring the association between variables X and Y is given by the following formula:
\[r_p=\frac{S_{XY}}{\sqrt{S_{XX}S_{YY}}}\]
The sample Pearson correlation coefficient, r_{p} , is the point estimate of the population Pearson correlation coefficient
\[\rho_p=\frac{\sigma_{XY}}{\sqrt{\sigma_{XX}\sigma_{YY}}}\]
The Pearson correlation coefficient measures the degree of linear relationship between X and Y and 1 ≤ r_{p} ≤ +1, so that r_{p} is a "unitless" quantity, i.e., when you construct the correlation coefficient the units of measurement that are used cancel out. A value of +1 reflects perfect positive correlation and a value of 1 reflects perfect negative correlation.
For the Pearson correlation coefficient, we assume that both X and Y are measured on a continuous scale and that each is approximately normally distributed.
The Pearson correlation coefficient is invariant to location and scale transformations. This means that if every X_{i} is transformed to
X_{i} * = aX_{i} + b
and every Y_{i} is transformed to
Y_{i} * = cY_{i} + d
where a > 0, b, c > 0, and d are constants, then the correlation between X and Y is the same as the correlation between X* and Y*.
With SAS, PROC CORR is used to calculate r_{p} . The output from PROC CORR includes summary statistics for both variables and the computed value of r_{p} . The output also contains a pvalue corresponding to the test of:
H_{0} : ρ_{p} = 0 versus H_{0} : ρ_{p} ≠ 0
It should be noted that this statistical test generally is not very useful, and the associated pvalue, therefore, should not be emphasized. What is more important is to construct a confidence interval.
The sampling distribution for Pearson's r_{p} is not normal. In order to attain confidence limits for r_{p} based on a standard normal distribution, we transform r_{p} using Fisher's Z transformation to get a quantity, z_{p} , that has an approximate normal distribution. Then we can work with this value. Here is what is involved in the transformation.
Fisher's Z transformation is defined as
\[z_p=\frac{1}{2}log_e\left( \frac{1+r_p}{1r_p} \right) \sim N\left( \zeta_p , sd=\frac{1}{\sqrt{n3}} \right)\]
where
\[\zeta_p=\frac{1}{2}log_e\left( \frac{1+\rho_p}{1\rho_p} \right)\]
We will use this to get the usual confidence interval, so, an approximate 100(1  α)% confidence interval for ζ_{p} is given by [z_{p, α/2} , z_{p, 1α/2} ], where
\[z_{p , \alpha/2}=z_p\left( t_{n3 , 1\alpha/2}/\sqrt{n3} \right) , z_{p , 1\alpha/2}=z_p+\left( t_{n3 , 1\alpha/2}/\sqrt{n3} \right)\]
But really what we want is an approximate 100(1  α)% confidence interval for ρ_{p} is given by [r_{p, α/2} , r_{p, 1α/2} ], where
\[r_{p , \alpha/2}=\frac{exp(2z_{p , \alpha/2})1}{exp(2z_{p , \alpha/2})+1},r_{p , 1\alpha/2}=\frac{exp(2z_{p , 1\alpha/2})1}{exp(2z_{p , 1\alpha/2})+1}\]
Again, you do not have to do this by hand. PROC CORR in SAS will do this for you but it is important to have an idea of what is going on.
The Spearman rank correlation coefficient, r_{s} , is a nonparametric measure of correlation based on data ranks. It is obtained by ranking the values of the two variables (X and Y) and calculating the Pearson r_{p} on the resulting ranks, not the data itself. Again, PROC CORR will do all of these actual calculations for you.
The Spearman rank correlation coefficient has properties similar to those of the Pearson correlation coefficient, although the Spearman rank correlation coefficient quantifies the degree of linear association between the ranks of X and the ranks of Y. Also, r_{s} does not estimate a natural population parameter (unlike Pearson's r_{p} which estimates ρ_{p} ).
An advantage of the Spearman rank correlation coefficient is that the X and Y values can be continuous or ordinal, and approximate normal distributions for X and Y are not required. Similar to the Pearson r_{p} , Fisher's Z transformation can be applied to the Spearman r_{s} to get a statistic, z_{s} , that has an asymptotic normal distribution for calculating an asymptotic confidence interval. Again, PROC CORR will do this as well.
The Kendall taub correlation coefficient, τ_{b} , is a nonparametric measure of association based on the number of concordances and discordances in paired observations.
Suppose two observations (X_{i} , Y_{i} ) and (X_{j} , Y_{j} ) are concordant if they are in the same order with respect to each variable. That is, if
(1) X_{i }< X_{j} and Y_{i} < Y_{j} , or if
(2) X_{i} > X_{j} and Y_{i} > Y_{j}
They are discordant if they are in the reverse ordering for X and Y, or the values are arranged in opposite directions. That is, if
(1) X_{i} < X_{j} and Y_{i} > Y_{j} , or if
(2) X_{i} > X_{j} and Y_{i} < Y_{j}
The two observations are tied if X_{i} = X_{j} and/or Y_{i} = Y_{j} .
The total number of pairs that can be constructed for a sample size of n is
\[N=\binom{n}{2}=\frac{1}{2}n(n1)\]
N can be decomposed into these five quantities:
\[N = P + Q + X_0 + Y_0 + (XY)_0\]
where P is the number of concordant pairs, Q is the number of discordant pairs, X_{0} is the number of pairs tied only on the X variable, Y_{0} is the number of pairs tied only on the Y variable, and (XY)_{0} is the number of pairs tied on both X and Y.
The Kendall taub for measuring order association between variables X and Y is given by the following formula:
\[t_b=\frac{PQ}{\sqrt{(P+Q+X_0)(P+Q+Y_0)}}\]
This value becomes scaled and ranges between 1 and +1. Unlike Spearman it does estimate a population variance as:
\[t_b \text{ is the sample estimate of } t_b = Pr[\text{concordance}]  Pr[\text{discordance}]\]
The Kendall taub has properties similar to the properties of the Spearman r_{s}. Because the sample estimate, t_{b} , does estimate a population parameter, t_{b} , many statisticians prefer the Kendall taub to the Spearman rank correlation coefficient.
SAS Example (19.1_correlation.sas): Age and percentage body fat were measured in 18 adults. SAS PROC CORR provides estimates of the Pearson, Spearman, and Kendall correlation coefficients. It also calculates Fisher's Z transformation for the Pearson and Spearman correlation coefficients in order to get 95% confidence intervals.
The resulting estimates for this example are 0.7921, 0.7539, and 0.5762, respectively for the Pearson, Spearman, and Kendall correlation coefficients. The Kendall taub correlation typically is smaller in magnitude than the Pearson and Spearman correlation coefficients.
The 95% confidence intervals are (0.5161, 0.9191) and (0.4429, 0.9029), respectively for the Pearson and Spearman correlation coefficients. Because the Kendall correlation typically is applied to binary or ordinal data, its 95% confidence interval can be calculated via SAS PROC FREQ (this is not shown in the SAS program above).
Correlation is a widelyused analysis tool which sometimes is applied inappropriately. Some caveats regarding the use of correlation methods follow.
1. The correlation methods discussed in this chapter should be used only with independent data; they should not be applied to repeated measures data where the data are not independent. For example, it would not be appropriate to use these measures of correlation to describe the relationship between Week 4 and Week 8 blood pressures in the same patients.
2. Caution should be used in interpreting results of correlation analysis when large numbers of variables have been examined, resulting in a large number of correlation coefficients.
3. The correlation of two variables that both have been recorded repeatedly over time can be misleading and spurious. Time trends should be removed from such data before attempting to measure correlation.
4. To extend correlation results to a given population, the subjects under study must form a representative (i.e., random) sample from that population. The Pearson correlation coefficient can be very sensitive to outlying observations and all correlation coefficients are susceptible to sample selection biases.
5. Care should be taken when attempting to correlate two variables where one is a part and one represents the total. For example, we would expect to find a positive correlation between height at age ten and adult height because the second quantity "contains" the first quantity.
6. Correlation should not be used to study the relation between an initial measurement, X, and the change in that measurement over time, Y  X. X will be correlated with Y  X due to the regression to the mean phenomenon.
7. Small correlation values do not necessarily indicate that two variables are unassociated. For example, Pearson's r_{p} will underestimate the association between two variables that show a quadratic relationship. Scatterplots should always be examined.
8. Correlation does not imply causation. If a strong correlation is observed between two variables A and B, there are several possible explanations: (a) A influences B; (b) B influences A; (c) A and B are influenced by one or more additional variables; (d) the relationship observed between A and B was a chance error.
9. "Regular" correlation coefficients are often published when the researcher really intends to compare two methods of measuring the same quantity with respect to their agreement. This is a misguided analysis, because correlation measures only the degree of association; it does not measure agreement. The next section of this lesson will present a measure of agreement.
How well do two diagnostic measurements agree? Many times continuous units of measurement are used in the diagnostic test. We may not be interested in correlation or linear relationship between the two measures, but in a measure of agreement.
The concordance correlation coefficient, r_{c} , for measuring agreement between continuous variables X and Y (both approximately normally distributed), is calculated as follows:
\[r_c=\frac{2S_{XY}}{S_{XX}+S_{YY}+(\bar{X}\bar{Y})^2}\]
Similar to the other correlation coefficient, the concordance correlation satisfies 1 ≤ r_{c} ≤ +1. A value of r_{c} = +1 corresponds to perfect agreement. A value of r_{c} =  1 corresponds to perfect negative agreement, and a value of r_{c} = 0 corresponds to no agreement. The sample estimate, r_{c} , is an estimate of the population concordance correlation coefficient:
\[\rho_c=\frac{2\sigma_{XY}}{\sigma_{XX}+\sigma_{YY}+(\mu_{X}\mu_{Y})^2}\]
Let's look at an example that will help to make this concept clearer.
SAS Example (19.2_agreement_concordanc.sas) : The ACRN DICE trial was discussed earlier in this course. In that trial, participants underwent hourly blood draws between 08:00 PM and 08:00 AM once a week in order to determine the cortisol areaunderthecurve (AUC). The participants hated this! They complained about the sleep disruption every hour when the nurses came by to draw blood, so the ACRN wanted to determine for future studies if the cortisol AUC calculated on measurements every two hours was in good agreement with the cortisol AUC calculated on hourly measurements. The baseline data were used to investigate how well these two measurements agreed. If there is good agreement, the protocol could be changed to take blood every two hours.
Note for this SAS program  Run the program to view the output. This is higher level SAS than you are expected to program yourself in this course, but some of you may find the programming of interest. 
The SAS program yielded r_{c} = 0.95 and a 95% confidence interval = (0.93, 0.96). The ACRN judged this to be excellent agreement, so it will use twohourly measurements in future studies.
What about binary or ordinal data? Cohen's Kappa Statistic will handle this...
Cohen's kappa statistic, κ , is a measure of agreement between categorical variables X and Y. For example, kappa can be used to compare the ability of different raters to classify subjects into one of several groups. Kappa also can be used to assess the agreement between alternative methods of categorical assessment when new techniques are under study.
Kappa is calculated from the observed and expected frequencies on the diagonal of a square contingency table. Suppose that there are n subjects on whom X and Y are measured, and suppose that there are g distinct categorical outcomes for both X and Y. Let f_{ij} denote the frequency of the number of subjects with the ith categorical response for variable X and the jth categorical response for variable Y.
Then the frequencies can be arranged in the following g × g table:
Y = 1

Y = 2

...

Y = g


X = 1

f_{11}

f_{12}

...

f_{1g}

X = 2

f_{21}

f_{22}

...

f_{2g}

 

 

 
...
... 

 
X = g

f_{g1}

f_{g2}

...

f_{gg}

The observed proportional agreement between X and Y is defined as:
\[p_0=\frac{1}{n}\sum_{i=1}^{g}f_{ii}\]
and the expected agreement by chance is:
\[p_e=\frac{1}{n^2}\sum_{i=1}^{g}f_{i+}f_{+i}\]
where f_{i+} is the total for the ith row and f_{+i} is the total for the ith column. The kappa statistic is:
\[\hat{\kappa}=\frac{p_0p_e}{1p_e}\]
Cohen's kappa statistic is an estimate of the population coefficient:
\[\kappa=\frac{Pr[X=Y]Pr[X=YX \text{ and }Y \text{ independent}]}{1Pr[X=YX \text{ and }Y \text{ independent}]}\]
Generally, 0 ≤ κ ≤ 1, although negative values do occur on occasion. Cohen's kappa is ideally suited for nominal (nonordinal) categories. Weighted kappa can be calculated for tables with ordinal categories.
SAS Example (19.3_agreement_Cohen.sas) : Two radiologists rated 85 patients with respect to liver lesions. The ratings were designated on an ordinal scale as:
0 ='Normal' 1 ='Benign' 2 ='Suspected' 3 ='Cancer'
SAS PROC FREQ provides an option for constructing Cohen's kappa and weighted kappa statistics.
The weighted kappa coefficient is 0.57 and the asymptotic 95% confidence interval is (0.44, 0.70). This indicates that the amount of agreement between the two radiologists is modest (and not as strong as the researchers had hoped it would be).
Note: Updated programs for examples 19.2 and 19.3 are in the folder for this lesson. Take a look.
In this lesson, among other things, we learned how to:
Let's put what we have learned to use by completing the following homework assignment:
Look for homework assignment and the dropbox in the folder for this week in ANGEL.