|
⇤ ← Revision 1 as of 2023-06-08 19:25:09
Size: 515
Comment:
|
Size: 495
Comment: Rewrite
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 3: | Line 3: |
| The '''`assert`''' command raises an error if a condition is not true. | '''`-assert-`''' raises an error if a condition is not true. |
| Line 18: | Line 18: |
| The `assert` command can also be used with [[Stata/Macros|macros]], [[Stata/Scalars|scalars]], and [[Stata/StoredResults|stored results]]. | `-assert-` can also be used with [[Stata/Macros|macros]], [[Stata/Scalars|scalars]], and [[Stata/StoredResults|stored results]]. |
Stata Assert
-assert- raises an error if a condition is not true.
Contents
Usage
assert foo==1 assert foo==1 if bar==1
-assert- can also be used with macros, scalars, and stored results.
count if foo==1 assert r(N)==0
