Glossary Tests and Global Variables

 

You can write TEST statements which let you create a list of respondents qualifying for a test condition, helping you explore and clean data. Test statements are defined in the glossary dialog box using Setup|Glossary Variables.

 

Syntax:

TEST label = logic for test condition

 

Example 1 (Variable data):

TEST A = NOT {AGE (1-9) OR INCOME (1-9)}

meaning, "for test A include respondents who do not have codes (1-9) in the variable AGE or in the variable INCOME."

 

Example 2 (ASCII data):

TEST B = NOT {2/40 (1-9) OR 2/41 (1-9)}

meaning, "for test B include respondents who do not have codes (1-9) in record 2, position 40 or in record 2, position 41."

 

Example 3 (Variable data):

TEST Q1 = Q1 (1) AND NOT Q2 (1-6)

meaning, "for test Q1 include respondents who in variable Q1, have a code 1 and do not have codes 1-6 in variable Q2."

 

Example 4 (ASCII data):

TEST Q1 = 1/4 (1) AND NOT 1/9 (1-6)

meaning, "for test Q1 include respondents who in record 1, position 4, have a code 1 and do not have codes 1-6 in record 1, position 9."

 

Important information:

Before selecting Run to process your TEST statements, choose the following specifications:

 

Show data file information

Show data file information is only applicable to variable type data files. Use this option to display the following information about the variable data file:

Show variables that match tests

Displays the data for the variable(s) or record/column location(s) specified for all respondents that meet each test condition.

 

Show a summary of tests

Displays the following Summary of Tests information:

Use glossary transformations

Includes any glossary statements written in the Setup Glossary Variables dialog box when processing TEST statements.

 

Show a summary of global variables

Displays the following Summary of Global Variables information:

Note: The Show a summary of global variables option can only be selected if Use glossary transformations has been specified.

 

Max. number of tests

You can limit the number of respondents to meet the test. For example, you can use Max. number of tests to determine an invalid test, by assuming the test is incorrectly specified when the maximum number is reached. You can use this feature to decrease the size of the error listing while still alerting you to a possible problem.

 

Records per case

Enter the number of records per case in the Records per case field. For variable type data, Records per case is not applicable.

 

Number of cases to test

Enter the number of cases/respondents to include when processing TEST statements and Global Variables.

 

Additonal variables to appear in the report

For variable type data files, select any additional variables that you would like to display when processing TEST statements. The data for additional variables selected will display on the Glossary Tests and Global Variables report for records meeting the TEST conditions.

 

Add

When you've made the specifications listed above, use the appropriate options as follows:

 

Run

Process TEST statements and/or a Summary of Global Variables.

 

Find

Print Report

Prints the glossary tests and/or summary of global variables results.

 

Save Report As

Saves the results to a file (the default extension is *.tst). When results are not saved, they are overwritten by the next processing of glossary tests and global variables.

 

Close

Closes the Glossary Tests and Global Variables dialog prior to or after processing.

Related topics:

Glossary Variables

Global Variables