Stata 15 help for _vassert


[P] _vassert -- Verify two variables are equal


_vassert var1 var2 [if] [in] [, tol(real) scale(real) nostop]


_vassert verifies that reldif(var1,var2) < tol is true. If it is true, the command produces no output. If it is not true, _vassert informs you of the "assertion failure", displays a summary of 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).

scale(scale) scales the variables by scalar scale. This option is used when reldif() asymptotically becomes an absolute difference for abs(x)<1.

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

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