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 on-line data recoding facility, which is accessible at any point from the spreadsheet by clicking the Vars button and selecting Recode or selecting 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 datafile, and then use this facility to create the new values. For instance, the recoding conditions could be used to assign 1’s to the new variable for all “male subjects 18 to 25 years old with cholesterol levels below 200,” 2’s to “male subjects 18 to 25 years old with cholesterol levels above 200,” and assign t