Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: funny results with -cluster- in -somersd-


From   "Feiveson, Alan H. (JSC-SK311)" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: funny results with -cluster- in -somersd-
Date   Thu, 19 Mar 2009 09:14:50 -0500

Hi - I've been using -somersd- to make within-stratum comparisons and also use the -cluster- option to account for repeated observations for each value of id. In this example, there are 10 vlaues of id, each replicated 4 times. Also in this data there is another variable u, which is a random uniform number - so all the values of u are distinct. Therefore, I would expect that if I make comparisons within strata, I should get tau_uu = 1. I thought that to account for the clusters in within-stratum comparisons I had to use -funtype(wcluster)-. But results are strange. Here is what I tried:

A)
. somersd u u , funtype(wcluster) cluster(id)  wstrata(id) taua
Within-cluster Kendall's tau-a with variable: u
Transformation: Untransformed
Within strata defined by: id
Valid observations: 40
Number of clusters: 10

Symmetric 95% CI
                                    (Std. Err. adjusted for 10 clusters in id)
------------------------------------------------------------------------------
             |              Jackknife
           u |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           u |        .75          .        .       .            .           .
           u |        .75          .        .       .            .           .
------------------------------------------------------------------------------

B)
. somersd u u ,  cluster(id)  wstrata(id) taua
Kendall's tau-a with variable: u
Transformation: Untransformed
Within strata defined by: id
Valid observations: 40
Number of clusters: 10

Symmetric 95% CI
                                    (Std. Err. adjusted for 10 clusters in id)
------------------------------------------------------------------------------
             |              Jackknife
           u |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           u |  (dropped)
           u |  (dropped)
------------------------------------------------------------------------------

C)
. somersd u u , funtype(wcluster)   wstrata(id) taua
Within-cluster Kendall's tau-a with variable: u
Transformation: Untransformed
Within strata defined by: id
Valid observations: 40

Symmetric 95% CI
------------------------------------------------------------------------------
             |              Jackknife
           u |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           u |  (dropped)
           u |  (dropped)
------------------------------------------------------------------------------

D)
. somersd u u ,    wstrata(id) taua
Kendall's tau-a with variable: u
Transformation: Untransformed
Within strata defined by: id
Valid observations: 40

Symmetric 95% CI
------------------------------------------------------------------------------
             |              Jackknife
           u |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           u |          1          .        .       .            .           .
           u |          1          .        .       .            .           .
------------------------------------------------------------------------------

In case A, I get tau_uu = 0.75 (not 1).
In cases B and C (if either funtype or cluster are missing), I get zilch.
In case D, without any references to cluster, I get the "correct" value. But I want to account for the clusters- what am I missing?

Thanks

Al Feiveson
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index