Stata Assert

The assert command raises an error if a condition is not true.


Usage

assert foo==1
assert foo==1 if bar==1

The assert command can also be used with macros, scalars, and stored results.

count if foo==1
assert r(N)==0


See also

Stata manual for assert


CategoryRicottone

Stata/Assert (last edited 2023-06-08 19:25:09 by DominicRicottone)