Statalist


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

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


From   "Newson, Roger B" <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: funny results with -cluster- in -somersd-
Date   Thu, 19 Mar 2009 19:46:17 +0000

PPS if Al wants a within-cluster Kendall's tau-a to be 1 in the absence of ties, then Al should use the -bstrata(_N)- option. I have included an example (based on Al's example) below my signature.

I hope this helps.

Best wishes

Roger


Roger B Newson BSc MSc DPhil
Lecturer in Medical Statistics
Respiratory Epidemiology and Public Health Group
National Heart and Lung Institute
Imperial College London
Royal Brompton Campus
Room 33, Emmanuel Kaye Building
1B Manresa Road
London SW3 6LR
UNITED KINGDOM
Tel: +44 (0)20 7352 8121 ext 3381
Fax: +44 (0)20 7351 8322
Email: [email protected] 
Web page: http://www.imperial.ac.uk/nhli/r.newson/
Departmental Web page:
http://www1.imperial.ac.uk/medicine/about/divisions/nhli/respiration/popgenetics/reph/

Opinions expressed are those of the author, not of the institution.

**** BEGINNING OF Stata LOG - CUT HERE
. *
>  Making Kendall's tau-a equal to 1 with bstrata(_n)
> *;
. somersd u u ,  cluster(id)  funtype(wcluster) taua tdist bstrata(_n);
Within-cluster Kendall's tau-a with variable: u
Transformation: Untransformed
Between strata defined by: _n
Valid observations: 40
Number of clusters: 10
Degrees of freedom: 9

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

. somersd u u ,  cluster(id)  funtype(wcluster) taua transf(z) tdist bstrata(_n);
Within-cluster Kendall's tau-a with variable: u
Transformation: Fisher's z
Between strata defined by: _n
Valid observations: 40
Number of clusters: 10
Degrees of freedom: 9

Symmetric 95% CI for transformed Kendall's tau-a
                                    (Std. Err. adjusted for 10 clusters in id)
------------------------------------------------------------------------------
             |              Jackknife
           u |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
           u |   17.61636          .        .       .            .           .
           u |   17.61636          .        .       .            .           .
------------------------------------------------------------------------------

Asymmetric 95% CI for untransformed Kendall's tau-a
                   Tau_a     Minimum     Maximum 
           u           1           1           1 
           u           1           1           1 
**** END OF Stata LOG - CUT HERE 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Feiveson, Alan H. (JSC-SK311)
Sent: 19 March 2009 14:15
To: [email protected]
Subject: st: funny results with -cluster- in -somersd- 

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/

*
*   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