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
Roberto Ferrer <[email protected]>
To
Stata Help <[email protected]>
Subject
Re: st: Kendalls tau-b difference between ktau and tabulate taub
Date
Sat, 25 Jan 2014 12:56:27 -0430
This works fine for me:
*----------------- begin code -------------------
clear all
set more off
input x y
3 5
6 7
2 3
9 4
7 5
4 2
end
ktau x y, stats(taub se)
tabulate x y, taub
*------------- end code -----------------------
On Sat, Jan 25, 2014 at 12:01 PM, 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.
>
> Thanks for any help
>
> John
>
>
> ----------------------------------------------------
> John Kornak, PhD
> Associate Professor in Residence
> Department of Epidemiology and Biostatistics
> University of California, San Francisco
> UCSF Box 0560
> 185 Berry Street, Lobby 5, Suite 5700
> San Francisco, CA 94107-1762
> Tel: 415-514-8028
> Fax: 415-514-8150
> Email: [email protected]
>
>
>
>
>
> *
> * 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/
*
* 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/