Stata Confirm

The confirm command asserts that specified variables match a specification.


Usage

Variables

Use confirm numeric variable VARLIST to confirm that each variable is numeric. Alternatively, consider confirm type TYPE variable VARLIST using any standard data type.

Use confirm string variable VARLIST to confirm that each variable is a string. Alternatively, consider confirm type str# variable VARLIST or confirm type strL variable VARLIST.

If simply verifying that a variable exists, try confirm variable VARLIST.

If simply checking variable names for validity, consider using either confirm names NEWVARNAMES or confirm new variable NEWVARNAMES The former would allow pre-existing variables, the latter would not.

Values

confirm number NUMEXPR asserts that an expression is a number.

confirm integer number NUMEXPR furthermore asserts that the number is an integer or in scientific notation.

Files

confirm file FILENAME asserts that a file exists and is readable.

confirm new file FILENAME verifies that a file does not exist, and that the filename can be opened for writing.

Stata Data Types

confirm frame FRAMENAME asserts that a frame exists.

confirm new frame FRAMENAME asserts that a name is valid for a new frame.

confirm matrix MATNAME asserts that a matrix exists.

confirm scalar SCALNAME asserts that a scalar exists.


See also

Stata manual for confirm


CategoryRicottone

Stata/Confirm (last edited 2023-06-09 14:11:52 by DominicRicottone)