Добавил:
Sekretar
kiopkiopkiop18@yandex.ru
t.me/Prokururor I Вовсе не секретарь, но почту проверяю
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Ординатура / Хирургия / Библиотека им академика М.И. Перельмана / Книга_155_библиотеки_им_акад_М_И_Перельмана
.pdf
12.2 Correlation 289
Example 12.6 Two inspectors visited separately nine hospitals in terms of
compliance of health protocols and ranked them according to Table
12.6. Obtain
correlation coefficient between the ranks of the two inspectors.
Solution: In this example, because we have ordinal data, like the previous example,
we find the difference in ranks (
d
i
= x
i
− y
i
) and their squares (d
2
i
) and substitute
them in the corresponding formula (Table
12.7).
r
s
= 1 −
6
d
2
i
n
n
2
− 1
= 1 −
6 × 21.5
9
9
2
− 1
= 1 − 0.179 = 0.821
There is a strong positive correlation between the rankings of these two health
inspectors.
Example 12.7 Find Spearman correlation coefficient between number of absence
and final grade for data in Table
12.1.
Solution: In this example, the number of absences more than 10 sessions seems to
be outliers and affects Pearson correlation coefficient. Therefore, using Spearman
correlation coefficient would be more appropriate. We sort the rankings of both
variables in columns 3 and 4 and record their difference in column 5. Then, the
differences are squared and the sum is placed in the corresponding formula to obtain
Spearman correlation coefficient (Table
12.8).
r
S
= 1 −
6
d
2
i
n
n
2
− 1
= 1 −
6 × 716
13
13
2
− 1
= 1 − 1.967 =−0.967
Table 12.7 Ranking of 9 visited hospitals
Hospital First inspector Second inspector d
i
d
2
i
A 9 8 1 1
B 6 2.5 3.5 12.25
C 7 7 0 1
D 5 6 −1 1
E 8 10 −2 4
F 1 1 0 0
G 3 4 −1 1
H 2 2.5 −0.5 0.25
I 4 5 −1 1
Sum 21.5
https://t.me/med1917

290 12 Correlation and Regression
Table 12.8 Ranking and calculation Spearman correlation coefficient for data in Table 12.1
Final grade Absence Rank of grade (x
i
) Rank of absence (y
i
) d
i
= x
i
− y
i
d
2
i
82 6 8.5 6 2.5 6.25
86 2 10 2.5 7.5 56.25
50 15 1 13 −12 144
74 9 5 9 −4 16
58 12 2 11.5 −9.5 90.25
90 5 11 4.5 6.5 42.25
78 8 7 7.5 −0.5 0.25
70 10 4 10 −6 36
65 12 3 11.5 −8.5 72.25
94 2 12 2.5 9.5 90.25
96 0 13 1 12 144
75 8 6 7.5 −1.5 2.25
82 5 8.5 4.5 4 16
Sum 716
12.2.6 Confidence Interval for Spearman Correlation
Coefficient
As with the Pearson correlation coefficient, we use the Fisher transformation for
the Spearman correlation coefficient to normalize its distribution. Then, by back
transformation of the calculated values, we obtain the confidence interval for the
Spearman correlation coefficient of the population.
z =
1
2
ln
1 + r
1 − r
The standard error of z is approximately:
Se
z
=
1.060
n − 3
Hence the 95% confidence interval for z is:
z
1
= z − 1.96 × Se
z
= z − 1.96 ×
1.060
n − 3
z
2
= z + 1.96 × S
z
= z + 1.96 ×
1.060
n − 3
https://t.me/med1917

12.2 Correlation 291
The 95% confidence interval for correlation coefficient of r is reachable by back
transformation of the above value as below:
e
2z
1
− 1
e
2z
1
+ 1
to
e
2z
2
− 1
e
2z
2
+ 1
The null and alternative hypotheses for hypothesis test are:
H
0
: ρ = 0
H
A
: ρ /= 0
The test statistics is:
t =
r
Se
(
r
)
= r
n − 2
1 − r
2
with df = n − 2
The test statistic should compare with two-tailed critical value from t distribution
table with degree of freedom (n−2).
Example 12.8 The correlation coefficient of the number of absences and the final
grade of a sample of 13 in Example 12.6 is equal to −0.967. Find the 95% confidence
interval and perform a significant test.
Solution: We first transform r =−0.967 to z as below. Negative sign in calculated
r is very important.
z =
1
2
ln
1 + r
1 − r
=
1
2
ln
1 +
(
−0.967
)
1 −
(
−0.967
)
=
1
2
ln 0.0168 =−2.044
The standard error of z is:
Se
z
=
1.060
n − 3
=
1.060
13 − 3
= 0.3256
The 95% confidence interval for z is:
z
1
= z − 1.96 × Se
z
=−2.044 − 1.96 × 0.3256 =−2.682
z
2
= z + 1.96 × S
z
=−2.044 + 1.96 × 0.3256 =−1.406
https://t.me/med1917

292 12 Correlation and Regression
After back transformation of the above values, 95% confidence interval for
correlation coefficient of r is:
Lower limit =
e
2z
1
− 1
e
2z
1
+ 1
=
e
2
(
−2.682
)
− 1
e
2
(
−2.682
)
+ 1
=
−0.9953
1.0047
=−0.991
Upper limit =
e
2z
2
− 1
e
2z
2
+ 1
=
e
2
(
−1.406
)
− 1
e
2
(
−1.406
)
+ 1
=
−0.9399
1.0601
=−0.887
The both confidence limits suggest that there really is quite a strong negative
association between the two variables in the population.
For significant test we need to the degree of freedom (df = n − 2 = 13 − 2 = 11)
and critical value at 0.05 significant level is
t
(
0.975,11
)
= 1.796.
t =
r
Se
(
r
)
= r
n − 2
1 − r
2
=
(
−0.967
)
13 − 2
1 −
(
−0.967
)
2
=−12.588
Since test statistics is greater than the critical value (
|
−12.588
|
> 1.796
) and fall
in reject region, we reject the null hypothesis and mean that there is a significant
difference with zero.
Tip
When the data is not in the ordinal scale, they should be assigned a ranking and
then the Spearman correlation coefficient should be calculated for the assigned
ranks (instead of the original data).
To calculate the Spearman correlation coefficient in SPSS, similar to run Pearson
correlation coefficient, first select the Analyze\Correlate\Bivariate path to open a
window. Then mark Spearman option to run program.
Significance test for correlation coefficient is also performed, and test statistic and
p-value are presented below the output table.
Example 12.9
If the rankings of hospitals by two health officers for example 12.5
(Table
12.5) are exactly the same, the Spearman correlation coefficient should be
equal to + 1. But if it is exactly in opposite order such as Table
12.7, the Spearman
correlation coefficient should be equal to −1. Do the calculations yourself to make
sure.
https://t.me/med1917

12.2 Correlation 293
12.2.7 Kendall’s Rank Correlation Coefficient
Tips
Concordant: A pair of observations is concordant if the subject who is higher
on one variable is also higher on the other variable or (
x
i
− x
j
) and (y
i
− y
j
)
have the same sign.
Discordant: A pair of observations is discordant if the subject who is higher
on one variable is lower on the other variable or (
x
i
− x
j
) and (y
i
− y
j
)have
opposite signs.
Kendall’s tau coefficient and Spearman’s rank correlation coefficient both evaluate
statistical relationships based on the ranks of the data. Kendall rank correlation, a non-
parametric method, serves as an alternative to the parametric Pearson’s correlation
when one or more assumptions of the test are violated. It also offers a viable alternative
to the non-parametric Spearman correlation, particularly when dealing with small
sample sizes and a significant number of tied ranks.
Kendall rank correlation is particularly suited for assessing similarities in the
ordering of data when ranked by quantities. It relies on pairs of observations to
determine the strength of association, focusing on the pattern of concordance and
discordance between these pairs. Typically, Kendall’s tau coefficient yields smaller
values compared to Spearman’s rho correlation.
The calculation of Kendall’s tau involves considering concordant and discordant
pairs within the dataset. This method tends to provide more accurate p-values,
especially in scenarios involving smaller sample sizes or the presence of outliers.
Kendall’s tau coefficient correlation can be obtained by the following formula:
τ =
2(n
C
D
n
(
n − 1
)
where n
C
is the number of concordant pairs and n
D
is the number of disconcordant
pairs.
Solution: To estimate Kendall’s tau, we first order one of the variables in ascending
ranks as in Table
12.9, which is ordered by age, and placed the ranks of the second
variable alongside (natural order); the body fat percentages now shift entirely to
the second variable. Then we allocate two columns for concordant pairs (C) and
discordant pairs (D).
Now we compare each rank of the second variable (body fat percentage) with its
subsequent ranks to see how many ranks are larger and how many ranks are below
it. We count the number of ranks larger than it (right order, concordant) and record
in column (C) and the number of ranks less than it (wrong order, disconcordant) and
write in column (D). We do this for all second variable ratings. The last rank or last
row remains empty because then there are no rankings to be compared. Then we sum
two columns
n
C
and n
D
and replace them in the formula (Table 12.10).
https://t.me/med1917

294 12 Correlation and Regression
Table 12.9 Ranking of 9 hospitals in opposite order
Subject Age
Body
fat%
Rank
Age
Rank
Body fat%
C D
E23 9.5 1 2 121
B25 10.1 2 3 111
A27 7.8 3 1 110
D41 25.9 4 5 91
H45 27.5 5 6 81
F49 25.4 6 4 80
M50 31.0 7 8 61
G53 54.7 8 14 06
K55 42.0 9 13 05
N56 32.5 10 9 31
G57 30.3 11 7 30
I58 33.8 12 10 20
O60 41.1 13 12 01
C61 34.5 14 11 --
Sum 73 18
Table 12.10 Ascending order of Table
12.8
Subject Age Body fat% Rank age Rank body fat% C D
E 23 9.5 1 2 12 1
B 25 10.1 2 3 11 1
A 27 7.8 3 1 11 0
D 41 25.9 4 5 9 1
H 45 27.5 5 6 8 1
F 49 25.4 6 4 8 0
M 50 31.0 7 8 6 1
G 53 54.7 8 14 0 6
K 55 42.0 9 13 0 5
N 56 32.5 10 9 3 1
G 57 30.3 11 7 3 0
I 58 33.8 12 10 2 0
O 60 41.1 13 12 0 1
C 61 34.5 14 11 − −
Sum 73 18
https://t.me/med1917

12.2 Correlation 295
So looking at the first rank, 2, it is followed by a 3, which is in the right order,
and therefore contributes concordant. It is then followed by 1, which is in the wrong
order, and therefore contributes concordant. It is then followed by 5, 6, 4, 8, 14, 13,
9, 7, 10, 12, and 11, all of which are greater than 2 and in the right order, so all
contribute concordant (concordant = 12 and disconcordant = 1). We then go to the
third row, rank in the body fat %, 1, and find (naturally) that all subsequent ranks 5,
6, 4, 8, 14, 13, 9, 7, 10, 12, and 11 are in the right order, so this column contributes
11 concordant and none disconcordant. And so it goes, and eventually we end up
with a total of
n
C
= 72 concordant and n
D
= 19 disconcordant. Now substitute n =
14,
n
D
= 19, and n
C
= 72 in the related formula to estimate Kendall’s tau.
τ =
2(n
C
− n
D
)
n
(
n − 1
)
=
2
(
73 − 18
)
14
(
14 − 1
)
= 0.604
12.2.8 Test Statistic and Confidence Interval for Kendall’s
Tau Correlation Coefficient
To calculate the confidence interval for Kendall’s tau, the same method as the
Spearman correlation coefficient must be performed. First, we use the z Fisher
transformation to normalize its sample distribution.
τ
z
= 0.5ln
1 + τ
1 − τ
The standard error of τ
z
is
Se
(
τ
z
)
=
0.437
n − 4
The lower and upper confidence limits for τ
z
are calculated by:
τ
z,L
= τ
z
− z
1−
α
2
× Se
(
τ
z
)
τ
z,U
= τ
z
+ z
1−
α
2
× Se
(
τ
z
)
where τ
z,L
and τ
z,U
are the lower and upper bounds, respectively, and z
1−
α
2
is the unit
normal critical z value for specified level of confidence
1 − α.
Using back transformation of the above-mentioned lower and upper limits, the
true confidence intervals of
τ for the population correlation are found.
https://t.me/med1917

296 12 Correlation and Regression
τ
L
=
exp
2 × τ
z,L
− 1
exp
2 × τ
z,L
+ 1
and τ
U
=
exp
2 × τ
z,U
− 1
exp
2 × τ
z,U
+ 1
The test statistic using the standard normal distribution is as follows:
z =
3 × τ ×
√
n
(
n − 1
)
√
2
(
2n + 5
)
This statistic is compared with its corresponding value in the standard normal
distribution table. If it is greater than the value of the table, the null hypothesis is
rejected, meaning that the Kendall’s tau correlation coefficient cannot be considered
equal to zero.
Example 12.10 Kendall’s tau correlation coefficient in Example 12.9 with a sample
size of 13 is 0.604. Find the test statistic and 95% confidence interval.
Solution: First, we transform the Kendall’s tau using the Fisher transformation as
follows and obtain its standard error.
τ
z
= 0.5ln
1 + τ
1 − τ
= 0.5ln
1 + 0.604
1 − 0.604
= 0.6994
Then, we get the upper and lower limits for the transformed values:
τ
z,L
= τ
z
− z
1−
α
2
× Se
(
τ
z
)
= 0.6994 − 1.96 × 0.22035 = 0.2675
τ
z,U
= τ
z
+ z
1−
α
2
× Se
(
τ
z
)
= 0.6994 + 1.96 × 0.22035 = 1.1313
Then, by using back transformation of the upper and lower limits obtained above
(
τ
z,L
and τ
z,U
), the confidence intervals for the population τ are obtained.
τ
L
=
exp
2 × τ
z,L
− 1
exp
2 × τ
z,L
+ 1
=
exp
(
2 × 0.2675
)
− 1
exp
(
2 × 0.2675
)
+ 1
=
0.7074
2.7074
= 0.261
τ
U
=
exp
2 × τ
z,U
− 1
exp
2 × τ
z,U
+ 1
=
exp
(
2 × 1.1313
)
− 1
exp
(
2 × 1.1313
)
+ 1
=
8.608
10.608
= 0.811
Thus, 95% confidence interval of Kendall’s tau correlation coefficient in the
population will be from 0.261 to 0.811.
The test statistic for this example is:
z =
3 × τ ×
√
n
(
n − 1
)
√
2
(
2n + 5
)
=
3 × 0.604 ×
√
13
(
13 − 1
)
√
2
(
2 × 13 + 5
)
=
22.632
7.874
= 2.874
https://t.me/med1917

12.2 Correlation 297
which is greater than corresponding value of standard normal distribution (1.96) and
the null hypothesis is rejected.
12.2.9 Point-Biserial Correlation
The biserial correlation and point-biserial correlation are specialized forms of the
Pearson correlation coefficient, specifically used when one variable is binary
(having only two levels) and the other variable is quantitative (ratio or interval
data). Binary variables are also referred to as dichotomous or dummy variables,
particularly in regression analysis. The binary variable can represent naturally
dichotomous traits, such as gender, or artificially dichotomized variables, like
categorizing blood pressure as normal or abnormal. However, it’s generally not
advisable to artificially dichotomize ordinal or quantitative data because they
contain more variance information than nominal data, thus potentially providing
more reliable correlation analysis.
Both the point-biserial correlation and biserial correlation aim to gauge the
strength and direction of the association between a quantitative variable and a
binary variable, which takes two distinct values (such as 0 and 1, or 2 and 3).
In medical contexts, questions that can be addressed using a point-biserial
correlation include inquiries into the effectiveness of a cancer drug in extending
life, assessing the association between drug administration (placebo versus drug)
and survival duration post-treatment, examining the relationship between gender
(female versus male) and cigarette consumption, or exploring the correlation
between hospitalization duration and gender among individuals with Covid-19.
Biserial Correlation: When the two responses of binomial variable are superior to
the other, the biserial correlation is a better estimate of the original Pearson
correlation. For example, when we want to calculate the correlation between IQ
and exam score, but the only available measurement about the exam scores is
passed or failed, employing biserial correlation has a more conceptual estimate.
Because we know that success is better than failure.
Point-Biserial Correlation: When dealing with binary variables that lack a natural
ordering, such as gender (where coding males as zero or one is arbitrary), they
are termed nominal binary variables. In such cases, the point-biserial correlation
coefficient is employed. This book focuses solely on the point-biserial correlation
coefficient due to its prevalence.
Mathematically, the point-biserial correlation coefficient (denoted as r_pb) is
computed similarly to the Pearson’s bivariate correlation coefficient. However, one
variable is dichotomous. As with other correlation coefficients, assumptions such
as normal distribution and homogeneity of variance for the quantitative variable are
necessary.
https://t.me/med1917

298 12 Correlation and Regression
Like all correlation coefficients, the point-biserial correlation coefficient ranges
from −1to + 1, with similar interpretations regarding strength and direction of the
relationship.
Suppose a quantitative random variable Y and a binary random variable X which
takes the values zero and one are available, the point-biserial correlation (
r
pb
) between
X and Y can be calculated by the formula below:
r
pb
=
Y
1
− Y
2
S
Y
n × p ×
(
1 − p
)
(
n − 1
)
Or equivalently:
r
pb
=
Y
1
− Y
2
S
Y
n
1
× n
2
n
(
n − 1
)
where S
Y
is the standard deviation of Y for all observations, which is calculated by:
S
Y
=
Y
i
− Y
2
n − 1
Y
1
is the mean value on the quantitative variable Y for all data points in group 1
and
Y
2
is the mean value on the quantitative variable Y for all data points i n group
2,
p is the proportion of number subjects in one of the groups to the total numbers,
and
n
1
is the sample s ize in in first group, n
2
is the sample size in second group, and
n is the total sample size in both groups.
Estimation of r
pb
is:
Var
r
pb
=
1 − r
2
pb
2
n
1 − 1.5 × r
2
pb
+
r
2
pb
4p
(
1 − p
)
An approximate confidence interval based on the normal distribution can be
calculated from these quantities using:
r
pb
± Z
1−
α
2
×
1 − r
2
pb
2
n
1 + r
2
pb
1 − 6p
(
1 − p
)
4p
(
1 − p
)
The null hypothesis that H
0
: ρ = 0 can be tested using the two-sample t-test.
t
pb
= r
pb
×
√
n − 2
1 − r
2
pb
https://t.me/med1917
Соседние файлы в папке Библиотека им академика М.И. Перельмана
