Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Slow STATA


From   Joseph Coveney <jcoveney@bigplanet.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Re: Slow STATA
Date   Tue, 12 Oct 2004 09:15:14 +0900

Joseph Wagner wrote:

I have had trouble running a series of simple exact tests.  Whenever my
tables go beyond 2x2 to tables such as the example below, STATA grinds to a
virtual halt.  I waited a half hour before pressing the "break" button.

tab score arm, exact

           |     Intervention
     Score | Lifestyle  Education |     Total
-----------+---------------------+---------
         0 |        38         54 |        92 
         1 |        73         73 |       146 
         2 |        56         58 |       114 
         3 |        29         37 |        66 
         4 |        21         20 |        41 
         5 |         6          3 |         9 
         6 |         3          3 |         6 
-----------+---------------------+---------
     Total |       226        248 |       474 


This is as far as STATA gets before it seems to stop.

I am using STATA v8.2, on a PIII PC with 512mb of RAM running XP
Professional.

--------------------------------------------------------------------------------

The Fisher-Irwin test for these data takes a long time on my PC, too.  (I 
believe that the Reference manual entry for -tabulate- warns of this.)  

But the do-file below doesn't.

Is there a special reason that you're using -tabulate, exact- on what appears 
to be ordered categorical data?

Joseph Coveney

clear
set more off
input byte Score byte Count0 byte Count1 int Total
 0 38 54 92 
 1 73 73 146 
 2 56 58 114 
 3 29 37 66 
 4 21 20 41 
 5  6  3  9 
 6  3  3  6 
end
drop Total
reshape long Count, i(Score) j(Intervention)
label define Intervention 0 Lifestyle 1 Education
label values Intervention Intervention
tabulate Score Intervention [fweight = Count]
drop if Count == 0 // not really needed for this dataset
expand Count
omodel logit Score Intervention
ranksum Score, by(Intervention) // another angle, same p-value
permute Intervention "ologit Score Intervention" X2 = e(chi2), reps(10000)
exit


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index