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:

Select the Data tab. In the Transformations group, click Recode.

Note: 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 (example, spaces, plus or minus signs). Variable names that include special characters must be enclosed in quotation marks (example, 'Score A'). If the quotation mark itself occurs in the variable name, use double quotation marks instead (such as "A's Score"). Note that if double quotation marks are used in the name, the variable name must be enclosed in single quotation marks.