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

RE: st: RE: Taking averages, etc.


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: RE: Taking averages, etc.
Date   Wed, 17 Dec 2003 13:25:36 -0000

Your previous reference to SPSS style 
had this example 

DO IF X1 = 1 and X2 = 3
    Compute Y = 3.
ELSE IF X3 = 2 and X4 = 17
    Compute Y = 4.
ELSE
    Compute Y = 5.
END IF.

I know epsilon about SPSS and zero about 
its internals. But if X1, X2, X3, X4 are variables, 
then the implementation within SPSS presumably 
means looking "inside", possibly at every element of each 
variable. How efficiently that's done is a different 
issue. In principle, SPSS must dig down and look
inside the variables to some extent. 

Nick 
n.j.cox@durham.ac.uk 

Richard Williams
 
> I'm not sure how that performs fewer tests.  The 
> if-then-else structure 
> only performs as many tests as are necessary whereas the 
> above would 
> perform 2 tests for each case.  In any event, I think I'd 
> be more likely to 
> make errors with syntax like this.  But that may just be me!
 

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