I know what -if- -else- does, but what if there is a -if- but not the -else-?
For example:
if exp {
command (A1)
command (A2)
...
}
command (B1)
command (B2)
...
How is it executed? my guess is:
If exp=1, both (A1), (A2),... and (B1), (B2),... are executed;
if exp=0, then only commands (B1), (B2),... are executed;
I sort of know this is the case, but cannot find any official document to confirm.
For example, the official help file does not specify it about this particular case:
https://www.stata.com/manuals13/pif.pdf
Related Posts with a basic question about -if- programming command
geocoding addresses to US census block groups and automationThe US Census has a neat online tool that lets you get the census tract and block group codes for up…
Share of working hour of an occupation in whole industryHello, I've been working CPS basic monthly sample and in the below data sample ahrswork1 stands for…
Problem in generating a new variableHello everyone, I have a question regarding generating a new variable in STATA. I am currently work…
Stack constant after running multiple regressionsDear all, Please kindly help. I would like to report the constants clearly after running my regress…
Question regarding calculating percentages of distinct valuesHello, Using Stata 16.1 for Mac, I have been doing quite a bit of searching online to try to figure …
Subscribe to:
Post Comments (Atom)
0 Response to a basic question about -if- programming command
Post a Comment