Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Probability and z statistic


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Probability and z statistic
Date   Tue, 5 Dec 2006 12:19:12 -0000

Your question seems analogous to 

. sysuse auto, clear

. tab for rep78 , taub

           |                   Repair Record 1978
  Car type |         1          2          3          4          5 |     Total
-----------+-------------------------------------------------------+----------
  Domestic |       200        800      2,700        900        200 |     4,800 
   Foreign |         0          0        300        900        900 |     2,100 
-----------+-------------------------------------------------------+----------
     Total |       200        800      3,000      1,800      1,100 |     6,900 

          Kendall's tau-b =   0.5589  ASE = 0.007

. ret li

scalars:
                 r(N) =  6900
                 r(r) =  2
                 r(c) =  5
              r(taub) =  .558892945435974
          r(ase_taub) =  .0070958155056459

. di r(taub) / r(ase_taub)
78.763737

I guess that ratio is the z-value you want, although 
some might label it -t-. Similarly, you can get a p-value
through whatever distribution and df is appropriate. You
just need to rummage around in the statistical functions. 

I guess this is available more directly as one of
several special cases of Roger Newson's -somersd-, 
but I could be wrong. 

Nick 
[email protected] 

Deidra Young
 
> I am interested in a simple solution to asking Stata to calculate the
> p-value and z statistic for comparing two groups by ordinal 
> categorical
> variables (mostly three to five categories).  When I use the 
> the following
> (in Stata 9):
> 
> tab autism kerr, all
> 
> Where autism is a variable denoting two groups of people and kerr is a
> ordered severity score for a clinical symptom, the chi square test is
> inappropriate due to the ordering of kerr (0 1 2 3) ranking 
> the severity of
> symptoms. This means that the Kendall tau-b score is more 
> appropriate as a
> measure and the approximate standard error is provided.  But how can I
> insert a command to request the calculation of the p value 
> for this (similar
> to the ktau procedure, but in the tab context above).
> 
> I have been working on this today and am perplexed about how 
> to automate
> this.  There seems to be an ado file for this available, but that is a
> little more complicated than necessary.  Also, I am new to 
> ado files (not
> tried one yet but have been looking at how to do these).
> 
> I wondered if I should try the new tabout.ado but I must print off the
> tutorial first.  It looks like a good program!  (but not for 
> producing p
> values).

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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