Stata 15 help for operators

Title

[U] 13.2 Operators

Syntax

Relational Arithmetic Logical (numeric and string) -------------------- ------------------ --------------------- + addition & and > greater than - subtraction | or < less than * multiplication ! not >= > or equal / division ~ not <= < or equal ^ power == equal - negation != not equal + string concatenation ~= not equal

A double equal sign (==) is used for equality testing.

The order of evaluation (from first to last) of all operators is ! (or ~), ^, - (negation), /, *, - (subtraction), +, != (or ~=), >, <, <=, >=, ==, &, and |.

Examples

. sysuse auto . generate weight2 = weight^2 . count if rep78 > 4 . count if rep78 > 4 & weight < 3000 . list make if rep78 == 5 | mpg > 25


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index