## Categorical Variables - How to reference categories

Categories are referenced by separating the variable name and the category name with a dot, all of which is contained in square brackets [ ]. For example, [Gender.Male]

“!Observed” and “!Missing” can be used to reference all observations or all ‘missing’ observations for a variable:

[Gender.!Observed] and [Gender.!Missing]

!HasValue and !Value can be used to reference all observations for a variable where the observed category has a value. For example:

[Variable.!HasValue]

[Variable.!Value]

#### Logical Operators

A logical operator compares two operands or expressions and produces a true or false condition. There are two types of logical operators: conditional and Boolean. Conditional operators compare two values or expressions. Boolean operators connect string, numeric, or logical expressions together to determine true-false logic. You can combine Operators to create complex operators.

= | Equal sign |

< | Less than |

> | Greater than |

NOT | Boolean (logical) NOT |

AND | Boolean AND |

OR | Boolean OR |

XOR | Boolean exclusive OR |

<> | Not equal |

!= | Not equal |

NOT | Not equal |

<= | Less than or equal to |

~> | Not greater than |

>= | Greater than or equal to |

During logical evaluation, any non-zero numeric value or non-blank string value indicates a true condition, and a null (blank) string or zero numeric value indicates a false condition.

Example:

Logical Expression Result

A=B | True when A is equal to B |

A < B | True when A is less than B |

A > B | True when A is greater than B |

A <> B | True when A is not equal to B |

A >= B | True when A is not less than B |

A <= B | True when A is not greater than B |

NOT A | True when A is null or zero |

A AND B | True when A is true and B is true |

A OR B | True when A is true, or B is true, or both are true |

A XOR B | True when A is true or B is true, but not both |