How do I create values of a new variable based on conditions met by other variables?

You can use either of the data transformation facilities: spreadsheet formulas or STATISTICA Visual Basic. However, often the quickest way to create values of a new variable based on conditions met by other variables is to use the STATISTICA data recoding facility, the Recode Values of Variable dialog box (described in What is the simplest way to recode values of a variable?), which is accessible at any point from the spreadsheet:

Ribbon bar. select the Data tab. In the Transformations group, click Recode.

Classic menus. Click the button and select Recode or select Recode from the Data menu.

Note that the currently selected variable does not even have to be included in the text of the recoding conditions. Thus, you can use this facility to create values of a variable based on conditions met by other variables.

For example, you can add a new (empty) variable to the data file, and then use this facility to create the new values. For instance, the recoding conditions could be used to assign 1s to the new variable for all "male subjects 18 to 25 years old with cholesterol levels below 200," 2s to "male subjects 18 to 25 years old with cholesterol levels above 200," and assign the missing data value to all other subjects.

Variable names can include special characters (e.g., spaces, plus or minus signs). Variable names that include special characters must be enclosed in quotation marks (e.g., 'Score A' ). If the quotation mark itself occurs in the variable name, use double quotation marks instead (e.g., "A's Score" ). Note that if double quotation marks are used in the name, the variable name must be enclosed in single quotation marks.