Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Kendalls tau-b difference between ktau and tabulate taub
From
Nick Cox <[email protected]>
To
"[email protected]" <[email protected]>
Subject
Re: st: Kendalls tau-b difference between ktau and tabulate taub
Date
Sat, 25 Jan 2014 17:32:57 +0000
-ktau- is a command (not a function) which expects sample values.
-tabi- is a command which expects cell frequencies.
Nick
[email protected]
On 25 January 2014 16:31, Kornak, John <[email protected]> wrote:
> Hi Statalist members,
>
> I am trying to figure out why I get different results using the stata function ktau versus tabulate with the taub option.
>
> For example if I have the following dataset
>
> . list
>
> +-------+
> | x y |
> |-------|
> 1. | 3 5 |
> 2. | 6 7 |
> 3. | 2 3 |
> 4. | 9 4 |
> 5. | 7 5 |
> 6. | 4 2 |
> +-------+
>
> .
>
> then using ktau I get
>
> . ktau x y, stats(taub se) [I have snipped the output to the relevant parts below]
>
> Kendall's tau-b = 0.1380
> SE of score = 5.228 (corrected for ties)
> .
>
> Within tabulate; (tabi 3 6 2 9 7 4\5 7 3 4 5 2, taub) I get
>
> Kendall's tau-b = -0.1667 ASE = 0.115
>
> If I transpose rows and columns I still get the same (i.e. with tabi 3 5\6 7\2 3\9 4\7 5\4 2, taub)
>
> Even cases like correlating 1,2,...,n with itself (tabi 1 1\2 2\3 3\4 4\ 5 5, taub) in tabulate gives an unexpected answer to me of 0.
>
> I am using Stata 13 on a macbook pro running OS X v. 10.8.5.
>
> Any insights into why I get differing answers would be very much appreciated. I expect I am misinterpreting what taub is supposed to be doing in tabulate.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/