Missing Values and Logical Operators (IF command)
When two or more relations are joined by logical operators AND or OR, the program always returns a missing value if all of the relations in the expression are missing. However, if any one of the relations can be determined, the program interprets the expression as true or false according to the logical outcomes below. The asterisk flags expressions where the program can evaluate the outcome with incomplete information.
| Expression | Outcome | Expression | Outcome |
|---|---|---|---|
| true AND true | = true | true OR true | = true |
| true AND false | = false | true OR false | = true |
| false AND false | = false | false OR false | = false |
| true AND missing | = missing | true OR missing | = true* |
| missing AND missing | = missing | missing OR missing | = missing |
| false AND missing | = false* | false OR missing | = missing |