Bookmark and Share

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: RE: kendall's tau or gamma


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: RE: kendall's tau or gamma
Date   Mon, 31 Oct 2011 16:49:05 +0000

There are no errors evident in your code. Stata just does not support
what you asked for  For example, the help for -tabulate- says

taub displays Kendall's tau-b along with its asymptotic standard error. taub is
        appropriate only when both variables are ordinal.  taub may
not be specified if
        aweights or iweights are specified.

So, that is one level of explanation for why your request failed.

Whether (a) the request does not make sense, or (b) appropriate
procedures just are not defined in the literature, or (c) StataCorp
just has not got round to implementing this is a question I cannot
easily answer, but my psychic powers are giving the strongest
vibrations for (b). Anything that depends on a underlying idea of
permuting possibilities is at least a bit tricky when weights are
added in: What happens to the weights? What difference do the weights
make to the asymptotics? Quite what is the sample size?

My earlier reply, ignored here, gave a big puff for -somersd- (SSC).

On the whole, however, this kind of single-measure factotum,
portmanteau, omnibus statistic approach peaked in the 1950s and Stata
itself has continued to move in quite different directions, despite
some early attention to the more popular of these measures.

Other people may have better informed comments.

Nick

On Mon, Oct 31, 2011 at 4:03 PM, Abelev, Melissa - FNS
<[email protected]> wrote:
> MODIFIED/CODE ADDED -- I'm trying to construct a crosstab on weighted, ordinal data.  Stata will do the crosstab.  When I try to get the gamma or kendall's tau (or any measures of association), it says "option gamma not allowed" (or substitute "gamma" for any measure I tried).  Why is this?  Can anyone provide some l= ight here?  I just need to be able to say whether or not the variables are = associated, and the strength and direction of the relationship...??
>
> You can see the progression of my code below, with the results.  When I run the tab without the weights, it's fine.
> . tab purchtrxcat bencat, taub
> (I get the table with the Kendall's tau below it)
>
> When I add the weights *without* the taub command, it's fine.
> .tab purchtrxcat bencat [aweight=fywgt]
> (I get a weighted cross-tab)
>
> When I try to weight the data *and* get taub however, I get an error message.
> .tab purchtrxcat bencat [aweight=fywgt], taub
> (Stata says:)
> option taub not allowed
> r(198);
>
> So then I tried
> svyset _n [pweight=fywgt], vce(linearized) singleunit(missing)
>
> But in the two-way tables, the only options for measures of association are chi2 and Wald, but I'm not familiar with Wald.
>
> The progression with results follows:
> . tab purchtrxcat bencat, taub
>
> purchtrxca |                                    bencat
>         t |         1          2          3          4          5          6          7 |     Total
> -----------+-----------------------------------------------------------------------------+----------
>         1 |       632      1,924        776         95         22          3          5 |     3,457
>         2 |       359      3,935      8,033      1,844      1,315        433        284 |    16,203
>         3 |        12        642      5,186      2,192      2,717      1,450      1,297 |    13,496
>         4 |         0        116      1,799        989      1,792      1,258      1,694 |     7,648
>         5 |         0         31        629        355        781        713      1,346 |     3,855
>         6 |         0         11        350        191        420        512      1,549 |     3,033
> -----------+-----------------------------------------------------------------------------+----------
>     Total |     1,003      6,659     16,773      5,666      7,047      4,369      6,175 |    47,692
>
>          Kendall's tau-b =   0.5282  ASE = 0.003
>
> . tab purchtrxcat bencat [aweight=fywgt]
>
> purchtrxca |                                    bencat
>         t |         1          2          3          4          5          6          7 |     Total
> -----------+-----------------------------------------------------------------------------+----------
>         1 | 556.01411   1,736.72  878.15302  91.446602  38.955687  1.4737055  2.1435293 | 3,304.906
>         2 | 325.32611  3,683.845  8,328.974  1,711.527  1,232.943  384.25979  296.64768 | 15,963.52
>         3 | 10.161731 637.417148   5,407.99  2,087.732  2,750.707  1,452.406  1,223.561 |13,569.975
>         4 |         0  116.30836  1,955.825  876.71062  1,825.956  1,286.674  1,568.736 |  7,630.21
>         5 |         0  37.457129  686.89222  336.23657  893.12914  719.02972  1,313.329 | 3,986.074
>         6 |         0  9.5271419  474.25455  158.99672  502.70048  562.16456  1,529.668 | 3,237.312
> -----------+-----------------------------------------------------------------------------+----------
>     Total | 891.50195  6,221.275  17,732.09 5,262.6498  7,244.391  4,406.008  5,934.085 |    47,692
>
>
> . tab purchtrxcat bencat [aweight=fywgt], taub
> option taub not allowed
> r(198);
>
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index