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

RE: st: RE: Taking averages, etc.


From   Richard Williams <[email protected]>
To   [email protected]
Subject   RE: st: RE: Taking averages, etc.
Date   Wed, 17 Dec 2003 08:52:53 -0500

At 01:30 PM 12/17/2003 +0000, Nick Cox wrote:
Let's not lose sight of where we started.
Stata has standard constructs

if ... {

}
else {

}

too; the point is that the conditional
testing cannot be vectorised.
Just so I'm clear as to what you mean: If I understand this correctly, if the statement is something like

if x1==1 {

and x1 = 1 for the FIRST case, then the statement is true, otherwise false; it won't matter what x1 = for the 2nd case. So, this kind of structure is not useful for case by case changes. It is useful for things like your earlier

if r(N) == 0 su mpg

where the value of r(N) (or whatever) is not going to change case by case. Sound right?

-------------------------------------------
Richard Williams, Associate Professor
OFFICE: (574)631-6668, (574)631-6463
FAX: (574)288-4373
HOME: (574)289-5227
EMAIL: [email protected]
WWW (personal): http://www.nd.edu/~rwilliam
WWW (department): http://www.nd.edu/~soc

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