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
Using inlist when with multiple & and or ( | ) statements to create dummies within a loopHello, In trying to clean up my code, I've run into a roadblock. I'm trying to create a dummy variab…
working with multi‐episode event history datasetAnyone with some experience working with multi‐episode event history dataset ? …
How to identify households with all members with no incomeDear All, I want to know how we check whether in each HH there is at least one member with income (…
Centering variablesHello, I have 16 countries across 30+years. My variables are slightly multi collinear as I have GDP…
Stacked bar: blabel using a different variableI am trying to create a stacked bar plot: Code: graph bar x1 x2, over(group) Command - Code: blabe…
Subscribe to:
Post Comments (Atom)
0 Response to a basic question about -if- programming command
Post a Comment