= 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 [[Stata/Macros|macros]], [[Stata/Scalars|scalars]], and [[Stata/StoredResults|stored results]]. {{{ count if foo==1 assert r(N)==0 }}} ---- == See also == [[https://www.stata.com/manuals/dassert.pdf|Stata manual for assert]] ---- CategoryRicottone