Journal of Econometrics
2 (1974) 241-246. 0 North-Holland
Publishing Company
CORRELATIONS WITH ORDINAL DATA David M. GRETHER California Institute of Technology, Pasadena, Calif. 91109, U.S.A. Received November
1973, revised version received March 1974
1. Introduction In most econometric analyses the data are uniquely defined except for a choice of units (e.g., physical quantities or value flows) and/or a location parameter (e.g., time). In some cases the cardinality of the data is less clear. For instance, building inspectors may rate various aspects of dwellings and neighborhoods on a one to five scale, the resulting indices being used in regressions explaining housing prices [Kain and Quigley (1970), King and Mieszkowski (1973)]. Battalio et al. (1973) recently pointed out that the sign of the correlation coefficient may not be invariant with respect to order preserving transformations of the ordinal variable and presented a numerical example. The exact conditions under which the sign of the sample correlation between a cardinal variable and an ordinal variable is ‘identified’ are given in section 2. The case of two ordinal variables is dealt with in section 3. 2. The correlation between an ordinal and a cardinal variable The theorem which follows allows for a simple test to see if the sign of the sample correlation between a cardinal variable (unique up to a choice of scale and origin) and an ordinal variable is determinate. One first arranges the observations on the cardinal variable (x) corresponding to, say, non-increasing values of the ordinal (z) ranking.’ Next calculate the partial sums of the deviations from the arithmetic mean for the cardinal variable : ci = 1 (Xi - X) for eachj such that Zj # zj+l. If these sums are all positive (negative) then the correlation between the cardinal variable and any representation of the ordinal ranking will be positive (negative). On the other hand, if the sums do not all have the same sign, then the correlation may be made positive or negative. ‘Let z be an n-tuple of numbers in non-increasing order, i.e., z1 2 zz 2 . . . 2 z,,. In this paper to say that z is a representation of an ordinal ranking means that it is considered equivalent with any other n-tuple with the same pattern of strict inequalities and equalities. To keep the exposition from becoming cumbersome we shall occasionally refer somewhat loosely to the ‘value of q’.
242
D.M. Grether, Correlations with ordinal data
To simplify the exposition, first consider the case in which there are no ties in the ordinal ranking.
Theorem 1: Let z = (z,, . . ., z,) be an n-tuple arranged in decreasing order z1 > z2 > z3 . . . > z,_ l > z, and let (x1 . . . x,,) be a Jixed n-tuple such that C:=l xi = 0. Then CT=, Xizi has the same sign for all order preserving transformations of z if and only if the partial sums ~{=1x,, j = 1,2, . . ., n - 1 all have the same sign. Prooj
It suffices to show that j=
1,2,...,
n-l
-fxizi
> 0
i=l
for all equivalent z’s. Suppose that for some k < n, If
cxi < 0. i=l
Then
Fori=2,...,
kands ti =
> Oset
2i-l-E,
for j =:2, . . ., n-k, 1 k+j
=~k+j_l-E.
For this choice of z ,
i$lXi2i =
~l~~-Ei~(i-l)Xi+~Ltli=~~~i-E~=~+~(i-k-l)XI
=
--E
(p,-Bk+l)i~xl
( gl(‘-lh+ Ir
i=$+l(i-k-l)Xi
-
Since the Only restriction on 21 and 2k+l is that & > I,+, , the sum can be made negative.:Conversely assume i
1
xi
O,
>
i=l
1,2 ,...,
j=
n-l.
Then k
iilxizi= C
XiZi
+
XiZip
i i=k+l
i=1
k >
zk c~i i=l
+
~ i=k+
xizi 1
zk >
Zk+l
243
D.M. Grether, Correlations with ordinal data k
’
zk cxi+zk+l
i
i=l
l=k+l
Xt
k
=
c xi > 0.
(zkazk+l)
i=l
Q.E.D. Consider now the case in which there are some ties in the ordinal ranking so that zr = z2 = =
. . . =
. . . =z
ZI,
>
zIl+l
=
. . . =
Z12
>
. . . . . . =
ZIk
>
z,.+1
Ik+l)
wheren = I&+ 1. Define
xj =
xi,
i=IJ-l+i
j=
1,2 ,...,
k+l,
I,=O.
Then k+l f i=l
Xizi
=
C
xjzIj9
j=l
and one immediately obtains: Corollary: Let z = (zl, . . ., zn) be an n-tuple arranged in non-increasing order withzr,>~t,+~, j= I,2 ,..., k. Andlet x = (xl, . . ., x,) be a-fixed n-tuple such that C: =:l xi = 0. Then c’fcl xizi has the same sign for all order preserving transformations of z af and only tf the following partial sums cyZ1 Xj, M = 1, 2, . . ., k, all have the same sign. 3. The correlation between two ordinal variables Consider now the situation in which both variables are ordinal. For brevity only the case of positive correlation will be treated explicitly. Assume that there are no ties in either ranking and that z1 > z2 > . . . > z,. Since one can always make a mean correction without affecting the sample correlation, take z = 1 Xi = 0. Define p(xi) to be the rank of Xj, SO that p(xj) = k means that xi is the kth largest of the x’s. Also, define pi as the kth largest element of the set Mxlh
dx2h
* * -3 dxj>>*
Theorem 2. Let x and z be n-tuples with zl > zz > . . . > z,,. In order for the sample correlation to be positive for all order preserving transformations of x and z, it is necessary and sufficient that
Pi 5
j-k --_n+l, J
k=
1,2,. . ., j,
j < n.
244
D.M. Grether, Correlations with ordinal data
Let x(p) be the value of thepth largest xj., i.e., p&(p)) = p. l), and decrease all others by one. Note that this transformation preserves the ordering of the x’s and also keeps their sum equal to zero. The effect of this change has been to increase xi=, Xi by Cj-k)[(n- pi+ I)/(ph- l)] and to decrease it by k. If the net result of this is to lower the sum, then it is possible to make C{ = I xi negative. Thus by Theorem 1, it must be the case that (j- k)((n - pi+ l)/(& 1)) >=k or, equivalently, pi 5 ((j- k)/j)n + 1. Proof(Necessity).
Now increase each x which is greater than x(ph) by (n- pi+ l)/(ph-
(Sufficiency) Suppose
then
for 1 s d =< [n/j] where [z] is the integer part of z. Taken together inequalities imply that
these
(2) Now any positive integer may be written as n = j[rQ]+r,
osrsj-1.
It is easily seen that the sum in (2) contains all but r of the x’s, and that those x’s not included in (2) are of the form x([knljJ). Note that for thepth excluded x, bW = k[n/j]+p, so that [krfi] = p. I.e., k 5 jp/r (r # 0). Thus [kn/j] 2 jp/r[n/j] +p = p(n/r), which implies that [kn/j] 2 n- [(r-p)n/r]. The argument uses the following symmetry property: If for all equivalent x’s,
ki;(pyn]+
1) > 0,
then
To see this, notice that if there is a representation which violates the latter inequality, then changing the sign of each x and renumbering accordingly gives a representation which violates the first inequality.
D.M. Grether, Correlations with ordinal data
245
The proof proceeds as follows : If r is zero, then (2) implies that If= i x(i) < 0 which is a contradiction. Thus the theorem is true wheneverj = 1. By symmetry it is true whenever r = 1, which proves the result forj = 2. Continuing in this fashion establishes results for all j. Q.E.D. Though the conditions given in Theorem 2 are not hard to check, in some cases when the sign is indeterminate it may be possible to see this almost immediately. For example, p(xl) = 1 and p(x,) = n are both necessary for the sample correlation to be positive. Another necessary (but not sufficient) condition is that for each x, P(Xj) s (u- l)b)n + 1. Example 1.
Let n = 8
P(Z)
1
2
3
4
PC4
1
4356278
5
6
7
8
Each x satisfies the necessary condition, but by symmetry it also must be the case that p(zj*) s ((j- l)/j)n+ 1, where zj* is the value of z corresponding to the jth largest x. Since p(zz) = 6 > 5, the correlation could be negative. Example 2. PM
1
P(X) 1 x 10 -7
2
3
4
5
6
7
8
5
6
7
2
3
4
8
9
8
7
10
-8
-9
Both the x and z ranking satisfy the criteria, but x1 +x2 + xJ = - 5. Thus, for this example one needs the criteria given in Theorem 2. The conditions are satisfied for the first two terms, but not for the third as ps = 5 > 3$. In many applications the ordinal ranking will result from associating numerical values with each of a relatively small number of categories so that it will often be the case that there will be ties in the ordinal rankings. If there are ties in the z ranking, then by the corollary to Theorem 1, the test given in Theorem 2 need only be applied for thosej’s such that z, > Zj+ 1. Ties among the x’s can also be easily handled. Let n(i,j) be the number of elements of {x1, . . ., Xi} with rank i, and interpret p(Xj) = k to mean that there are k - 1 x’s greater than xi. Theorem 3. In order for xi=, is necessary and suficient that pi
s
xi to be non-negative for all equivalent x’s, it
.i--k-n(dJ)+ 1 n+l. j
Proof. The arguments given in the proof of Theorem 2 apply with weak rather than strict inequalities in the proof of sufficiency. Note that in testing to see if the sign of the correlation is identified, it is not really necessary to worry about ties in the x ranking. Thus, if the condition
D.M. Grether, Correlations with ordinal data
246
without ties is P4 $ 5, P’: 5 7, P! 5 3, then, allowing for a tie for p:, the test is P’: s
5,
P’: s
3,
Pt s
1,
pi 5 1.
So it suffices to calculate the test ranks for the case of no ties. 4. Summary and conclusions The preceding sections contain necessary and sufficient conditions for the sign of a sample correlation coefficient to be invariant with respect to order preserving transformations of one or both variables. As noted, the conditions are relatively easy to check; thus, the results allow one to determine if the sign of the correlation is determinate. In some sense the cases dealt with here may be extreme ones. In other words, it is not being claimed here that failing the proposed tests necessarily implies that meaningful statistical results cannot be obtained. For example, consider attempting to analyze the relationship between a cardinal variable (e.g., monthly rent or military expenditures) and an ordinal one (‘dwelling quality’ or ‘political accountability’). It may be that a researcher believes that the latter variables are well defined, but that existing measurement techniques are only capable of providing an ordering of objects with respect to the particular attribute. This is the type of problem studied by Mayer (1973) who pointed out that one could use the methods of isotonic regressions. Also, researchers who use quality indices for, say, neighborhoods or graduate faculties may not view these indices as being completely ordinal. Thus, rating Harvard 10, Yale 9, and Podunk 1 is supposed to convey more information than ‘Harvard is better than Yale which is better than Podunk’. However, unless one can reasonably limit the class of admissible order preserving transformations [see Krantz et al. (1971)] empirical results based upon linear correlation methods should be interpreted with caution.
References Battalio, R.C., J.R. Hulett and J.H. Kagel, 1973, A comment on J.J. Siegfried’s ‘The publishing of economic papers and its impact on graduate faculty rating 1960-69, The Journal of Economic Literature XI, 68-70. Kain. J.F. and J.M. Quigley, . - . 1970, Measuring the value of housing quality, Journal of the A;nerican Statistical Association 65,532-548. Kina. A.T. and P. Mieszkowski, 1973, Racial discrimination, segregation, and the price of housing, Journal of Political Economy 81,590-606. Krantz, D.H., R.D. Lute, P. Suppes and A. Tversky, 1971, Foundations of measurement, vol. I (Academic Press, New York). Mayer, L.S., 1973, Estimating a correlation coefficient when one variable is not directly observed, Journal of the American Statistical Association 68,420421.