gkgammatst

Goodman-Kruskal's gamma test.
516.0 次下载
更新时间 2013/7/16

查看许可证

It is an inference on the measure of correlation among two ordered qualitative variables. Measuring strength of association of cross tabulated data. It was proposed by Leo Goodman and William Kruskal across a series of papers (1954, 1959, 1963 and 1972).

A pair of observations is concordant if the subject who is higher on one variable also is higher on the other variable, and a pair of observations is discordant if the subject who is higher on one variable is lower on the other variable (Goktas and Qznur, 2011).

If C > D the variables have a positive association, but if C < D then the variables have a negative association. C and D are, respectivelly, the total number of concordances and discordances.

The ratio (C - D)/(C + D) is the Goodman-Kruskal´s gamma statistic (g). It can lie between -1 and 1. Sign indicates if ther is a negative or positive association. The magnitude indicates strength of association.

The asymtotic Goodman-Kruskal's gamma variance is calculated as,

varg = 4/(C + D)^2*(Sum_i Sum_j n_ij*((A_ij - B_ij)^2 - (C - D)^2/n)

where,
A_ij = Sum_k<i Sum_l<j a_kl + Sum_k>i Sum_l>j a_kl

B_ij = Sum_k>i Sum_l<j a_kl + Sum_k<i Sum_l>j a_kl

a_ij denote the observed frequency in cell (i,j) in an I x J contingency table.

Concordances, C is: C = Sum_i Sum_j a_ij*A_ij

Discordances, D is: D = Sum_i Sum_j a_ij*B_ij

The z-value = g/sqrt(varg)

Null hypothesis: no association (no relationship or independence) corresponding gamma = 0. Alternative hypothesis (one-sided) gamma < 0 or gamma > 0.

Syntax: function gkgammatst(x,alpha,tail)

Inputs:
x – rxc data matrix
alpha - significance value (default=0.05)
tail - two-sided=0; one-sided~=0

Output:
- Summary statistics from the analysis

引用格式

Antonio Trujillo-Ortiz (2024). gkgammatst (https://www.mathworks.com/matlabcentral/fileexchange/42645-gkgammatst), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Gamma Functions 的更多信息
社区

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.1.0.0

It was added an appropriate format to cite this file.

1.0.0.0