= 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 [[Stata/DataTypes|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 [[Stata/Frames|frame]] exists. `confirm new frame FRAMENAME` asserts that a name is valid for a new frame. `confirm matrix MATNAME` asserts that a [[Stata/Matrices|matrix]] exists. `confirm scalar SCALNAME` asserts that a [[Stata/Scalars|scalar]] exists. ---- == See also == [[https://www.stata.com/manuals/pconfirm.pdf|Stata manual for confirm]] ---- CategoryRicottone