Updated: Aug 27, 2020
There are many different functions in Stata that you can use to generate new variables or perform calculations. For example, the cond() function which we cover in this post, or the sqrt() function which you can use to instantly calculate the square root of all the observations in a variable. There are many different functions in Stata that all have their own syntax. When you are trying to use a function, but you are unsure of the syntax, you can look it up using the help command. When you search using this command you must make sure to specify the brackets () at the end of the function name. This allows Stata to determine that you are looking for a function so it can find the correct help page.
Use the following command in the command pane:
This command will pull up the following help file for the function cond():
Or this command for information on the sqrt() function:
Which pulls up this help file: