GoodmanKruskalGamma

GoodmanKruskalGamma[v1, v2]
gives the Goodman-Kruskal coefficient for the vectors and .

GoodmanKruskalGamma[m]
gives the Goodman-Kruskal coefficients for the matrix m.

GoodmanKruskalGamma[m1, m2]
gives the Goodman-Kruskal coefficients for the matrices and .

GoodmanKruskalGamma[dist]
gives the coefficient matrix for the multivariate symbolic distribution dist.

GoodmanKruskalGamma[dist, i, j]
gives the ^(th) coefficient for the multivariate symbolic distribution dist.

DetailsDetails

  • GoodmanKruskalGamma[v1, v2] gives the Goodman-Kruskal coefficient between and .
  • Goodman-Kruskal is a measure of monotonic association based on the relative order of consecutive elements in the two lists.
  • Goodman-Kruskal between and is given by , where is the number of concordant pairs of observations and is the number of discordant pairs.
  • A concordant pair of observations and is one such that both and or both and . A discordant pair of observations is one such that and or and .
  • If no ties are present, is equivalent to KendallTau.
  • The arguments and can be any real-valued vectors of equal length.
  • For a matrix m with columns, GoodmanKruskalGamma[m] is a × matrix of the -coefficients between columns of m.
  • For an × matrix and an × matrix , GoodmanKruskalGamma[m1, m2] is a × matrix of the -coefficients between columns of and columns of .
  • GoodmanKruskalGamma[dist, i, j] gives where is equal to Probability[(x1-x2)(y1-y2)>0, {{x1, y1}Distributeddisti, j, {x2, y2}Distributeddisti, j}] and is equal to Probability[(x1-x2)(y1-y2)<0, {{x1, y1}Distributeddisti, j, {x2, y2}Distributeddisti, j}] where is the ^(th) marginal of dist.
  • GoodmanKruskalGamma[dist] gives a matrix where the ^(th) entry is given by GoodmanKruskalGamma[dist, i, j].

ExamplesExamplesopen allclose all

Basic Examples (4)Basic Examples (4)

Goodman-Kruskal for two vectors:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Goodman-Kruskal for a matrix:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]//MatrixForm=

Goodman-Kruskal for two matrices:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
In[3]:=
Click for copyable input
Out[3]//MatrixForm=

Compute the Goodman-Kruskal for a bivariate distribution:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]//MatrixForm=

Compare to a simulated value:

In[3]:=
Click for copyable input
Out[3]//MatrixForm=
New in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »