Stata 15 help for _sassert


[P] _sassert -- Verify two scalars are equal


_sassert scalar1 scalar2 [, tol(real) nostop reldif(real) integer equal]


_sassert verifies that reldif(scalar1,scalar2) <= tol is true. If it is true, the command produces no output. If it is not true, _sassert informs you of the "assertion failure", displays the relative difference, and issues a return code of 9; see [U] 8 Error messages and return codes.


tol(real) sets the tolerance limit for the relative difference. The default is tol(1e-8).

nostop prevents termination with error code 9 but still displays the error message.

reldif(real) sets the scalar in the denominator of the relative difference computation, abs(scalar1)/(abs(scalar2)+reldif). Machine epsilon is a common alternative, c(epsdouble). The default is reldif(1.0).

integer states that scalar1 and scalar2 are integers, and a check for equivalence is to be performed.

equal checks for exact equivalency (within machine precision), for example, scalar1 == scalar2.

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