Visual Dashboard: Performing Statistical Analyses with Visual Tools

Defining New Variables

The Defined Variables Gadget in Visual Dashboard allows you to create, edit, or delete variables with no coding. To access the Defined Variables gadget, move your mouse over Defined Variables on the left-hand side of the screen or by clicking the variable symbol (x) in the Visual Dashboard toolbar.

Visual Dashboard toolbar, with the Variable button circled

Figure 8.69: Visual Dashboard toolbar, with the Variable button circled

 

Creating a New Variable

Project data are not always in the proper format needed for analysis. As an example, a patient’s age may be entered in a questionnaire but the ages may need to be in five-year increments for proper analysis. The data may contain county codes, but descriptive county names may be more useful for analysis. Creating a new variable is one of the functions of the Defined Variables gadget. By creating a new variable, the ages of patients can be recoded to five-year increments, or county names may be assigned to the county codes making the data useful for analysis. A new variable may be created to change the format of existing data with recoded value, simple assignment, formatted value, assigned expression, or by grouping existing variables.

 

Recoded Value

The New Variable with Recoded Value option assigns a new value to existing data and places the results in a defined variable. Click New Variable in the gadget and select With Recoded Value. The Add Recoded Variable dialog box appears.

 

Add Recoded Variable dialog box

Figure 8.70: Add Recoded Variable dialog box

 

  • The Source field drop-down list represents the column in the current data source that will have its values recoded.
  • The Destination field drop-down list represents a new column that will be temporarily created in the current data source to store the recoded values.
  • The Destination field type represents the data type of the new column that will be created to store the recoded values. The available options are text, numeric, or Yes/No.
  • The Maintain Sort Order Where Appropriate box is checked by default. Usually output in Visual Dashboard is sorted alphabetically or sequentially. Leave this box checked if you would like the output to remain sorted exactly in the sequence that the data were entered.
  • The Use Wildcards option can be used for text searches in the FROM column. This option is unchecked by default. The asterisk (*) is the wildcard character.
  • The From column identifies the bottom of a range of values or a single value. To recode a single value instead of a range, use this From column only and leave the To column blank. When used to recode a range of values, the recode range includes the value in the From column and extends up to, but not including the value in the To column. To recode all unspecified values, leave both From and To columns blank.
  • To value (if any) identifies the upper limit of a range of values to be recoded. The recode range does not include the value in the To column. This option only appears if a numeric variable is selected.
  • The Else Value represents an optional value to assign to any records that do not match the recoding rules above. If left blank, the value of the new variable on records that don’t match the recoding rules will be blank, null, or “Missing”.
  • Representation Value identifies the value to be assigned to the destination variable for the specified values of the source variable.
  • Fill Ranges can be used to automatically populate range values on a numeric source field and is a very quick way to create numeric groupings such as age categories.
  • OK accepts the current settings and data, and closes the form or window.
  • Cancel exits the window without saving or executing a command.

The following example demonstrates how to add a recoded variable:

In the E. coli Food History table, there are more than 60 different values for Age. When performing an analysis, it is difficult to compare all of the different age values. By grouping the age values in 10-year increments, analysis on this variable is simplified. To group the values in Age groupings or categories:

  1. Set the Data Source to the EColi.PRJ project.
  2. From the Form section, click FoodHistory. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select With Recoded Value. The Add Recoded Variable dialog box appears.
    Add Recoded Variable dialog box

    Figure 8.71: Add Recoded Variable dialog box

     

  6. From the Source field drop-down list, select Age.
  7. Click the Fill Ranges button. The Fill Ranges dialog box appears.
  8. Enter 0 for the Start value, 65 for the End value, and 10 for By.
    Add Recoded Variable/Fill Ranges

    Figure 8.72: Add Recoded Variable/Fill Ranges

     

  9. Click OK. The Add Recoded Variable dialog box appears with the From, To, and Representation columns populated.
    Add Recoded Variable Ranges populated

    Figure 8.73: Add Recoded Variable Ranges populated

     

  10. Click OK. The variables are recoded and the conditions appear in the Variable Definitions textbox.
    Variable Definitions dialog box

    Figure 8.74: Variable Definitions dialog box

     

To see the frequency of the new Age_RECODED values, right click on the canvas, and then select Add Analysis Gadget > Frequency. From the Frequency of list, select Age_RECODED and click OK.

 

Age_Recoded Frequency list

Figure 8.75: Age_Recoded Frequency list

 

The Age_Recoded variable contains eight distinct values, which makes analysis easier than with the original data set.

 

Simple Assignment

Simple Assignment will assign the value of an existing variable to a newly defined variable. The following example demonstrates Simple Assignment.

  1. Set the Data Source to the Sample.prj project.
  2. From the Data Source Explorer menu, select Surveillance. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget, or click the Variables icon in the top left. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select With Simple Assignment. The Simple Assignment dialog box appears.
    Add Variable with Simple Assignment dialog box

    Figure 8.76: Add Variable with Simple Assignment dialog box

     

  6. In the Assign field, enter Age_New.
  7. Select Difference in years from the Assignment type drop-down list.
  8. Select BirthDate from the Start Date drop-down list.
  9. Select SYSTEMDATE from the End Date drop-down list. The System Date is a system-level variable that represents the current date and time on your computer.
  10. Click OK. A description of the assignment appears in the Variable Definitions textbox within the Defined Variables gadget.

To see the Age_New variable in line list view, right click on the canvas and then select Add Analysis Gadget > Line List. Select Age_New from List of Variables to display and then click OK.

 

Simple Assignment Line List

Figure 8.77: Simple Assignment Line List

In this example, the current age of the patient is calculated from the difference between the birth date in the data source and the date the variable is created (current date in your computer). The Analysis Gadget > Line List view displays the new variable created via Simple Assignment.

 

Conditional Assignment

The Conditional Assignment option defines conditions and one or more events that occur if the specified conditions are met. If the condition is true, the first event is executed. An alternative event can be given after the ELSE statement. The ELSE statement will be executed if the first set of conditions is not true. If the statement is false and no ELSE statement is selected, the statement is bypassed. To add a new variable with a Conditional Assignment, move the cursor over the Defined Variables gadget on the left-hand side of the Visual Dashboard canvas or click the Variables icon in the top left. The gadget expands and becomes fully visible. Click the New Variable button and select With Conditional Assignment.

 

Add New Variable with Conditional Assignment

Figure 8.78: Add New Variable with Conditional Assignment

 

  • Assign Field indicates the new variable name.
  • Assign Field Type indicates the format of the new variable. The available options are Text, Numeric, or Yes/No.
  • Assign Condition determines whether subsequent commands will be run. If the condition specified in this textbox is true, the Assign Value will be applied.
  • Assign Value states the value of the new variable when the Assign Condition is true.
  • Use Else checkbox indicates whether an Else Value is specified. This checkbox is unmarked by default.
  • The Else Value is applied when the statement in the Assign Condition textbox is false.

In the following example, the YoungAdult variable will be conditionally assigned the value of Yes if the Age variable has a value between 17 and 30 inclusive. If the Age value falls outside of this range, a value of No will be assigned to YoungAdult.

  1. Set the Data Source to the Sample.prj project.
  2. From the Data Source Explorer menu, select Surveillance. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select With Conditional Assignment. The Add Variable with Conditional Assignment dialog box appears.
    Conditional Assignment / Create Edit Condition

    Figure 8.79: Conditional Assignment / Create Edit Condition

     

  6. In the Assign field, enter YoungAdult.
  7. Select Yes/No from the Assign field type drop-down list.
  8. Click on the Create/Edit Condition button. The Specify Assign Condition dialog box appears.
    Specify Conditional Assignment Condition dialog box

    Figure 8.80: Specify Conditional Assignment Condition dialog box

     

  9. Select Age from the Field Name drop-down list.
  10. Select is between from the Operator drop-down list.
  11. Enter 17 and 30 for Values. Click Add Condition.
  12. Click OK. The filter criteria appear in the Data Filters list.
  13. Click OK in the Specify Assign Condition dialog box.
  14. The condition now appears in the Assign Condition textbox within the Add Variable with Conditional Assignment dialog box.
  15. Select Yes from the Assign Value drop-down list.
  16. Check the Use Else checkbox.
  17. Select No from the Else Value drop-down list.
  18. Click OK. A description of the assignment appears in the Variable Definitions textbox within the Defined Variables gadget.

To see the YoungAdult variable in line list view, right click on the canvas and then select Add Analysis Gadget > Line List. Select YoungAdult from List of Variables to display and then click OK. Check marks illustrate the lines for which the conditional assignment is true.

 

YoungAdult Conditional Assignment Line List

Figure 8.81: YoungAdult Conditional Assignment Line List

Note: The Else clause at the end of the IF statement is important to specify what should happen if the conditions are not met. Without the Else clause, YoungAdult would be null or missing for any values falling outside the 17 to 30 range.

 

Formatted Value

The format and name of an existing variable may be changed with the Formatted Value option. This is currently only useful with date fields as demonstrated by the example below.

  1. Set the Data Source to the Sample.prj project.
  2. From the Data Source Explorer menu, select Surveillance. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget or click the Variables icon in the top left of the screen. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select With Formatted Value. The Add Formatted Value dialog box appears.
    Add Formatted Variable dialog box

    Figure 8.82: Add Formatted Variable dialog box

     

  6. Select BirthDate from the Source field drop-down list.
  7. The Destination field automatically shows the source field with a suffix of “FORMATTED” (i.e. “BirthDate_FORMATTED”). Modify the name of the Destination field as desired.
  8. Select the long date from the Format type drop-down list. Using the current system date, a sample long date value appears in the Preview field.
  9. Click OK. A description of the assignment appears in the Variable Definitions textbox within the Defined Variables gadget.

To see the BirthDate_FORMATTED variable in line list view, right click on the canvas and then select Add Analysis Gadget > Line List. Select BirthDate_FORMATTED from List of Variables to display and then click OK.

 

Formatted Variable line list

Figure 8.83: Formatted Variable line list

The Analysis Gadget > Line List view displays the new variable created via Formatted Value.

 

Assigned Expression

Assigned Expression assigns the result of an expression or the field value to a variable as demonstrated in the example below. In the following example, the zip code field is a number. To use the zip code in a map, a new zip code variable must be defined and assigned text values.

  1. Set the Data Source to the Sample.prj project.
  2. From the Data Source Explorer menu, select Surveillance. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget or click the Variables icon in the top left of the screen. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select With Assigned Expression. The Add Variable with Expression dialog box appears.
    Add Variable with Expression

    Figure 8.84: Add Variable with Expression

     

  6. In the Assign Field, enter Zip2.
  7. In the Expression field, type the syntax: ZipCode + ‘-0000’.
  8. Select Text from the Data type drop-down list.
  9. Click OK. The assignment appears in the Variable Definition textbox within the Defined Variables gadget.

To see the Zip2 variable in line list view, right click on the canvas and then select Add Analysis Gadget > Line List. Select Zip2 from List of Variables to display and then click Generate Line List.

 

Add Variable with Expression Line List

Figure 8.85: Add Variable with Expression Line List

 

Creating a Variable Group

The Create Variable Group option in Visual Dashboard allows for the temporary grouping of variables. This option is useful when there are many variables and analyzing each is impractical. Group variables can be used in the Combined Frequency and MxN/2×2 gadgets. The following example demonstrates how to create a variable group.

  1. Set the Data Source to the Sample.prj project.
  2. From the Data Source Explorer menu, select Oswego. Click OK.
  3. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget or click the Variable icon in the top left of the screen. The gadget expands and becomes fully visible.
  4. Click the New Variable button.
  5. Select Create Variable Group. The Create Group dialog box appears.
    Create Group variable options

    Figure 8.86: Create Group variable options

     

  6. In the Group field name, enter Exposure.
  7. Select JELLO and VANILLA from the Items to include in the group list. Hold down the Ctrl key on your keyboard to select more than one variable at a time.
  8. Click OK.
  9. The variable group statement now appears in the Variable Definitions textbox within the Defined Variables gadget.

 

Edit Variable

The Edit Variable option allows an existing variable definition to be changed. The following example will add a new variable to an existing Exposure group variable such as the one created in the section Creating a Variable Group.

  1. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget, or click the Variables icon in the top left of the screen. The gadget expands and becomes fully visible.
  2. Click the Edit Variable button.
    Variable group defined

    Figure 8.87: Variable group defined

     

  3. The Create Group dialog box appears, with JELLO and VANILLA highlighted.
  4. Press and hold the Ctrl key on your keyboard and select Spinach to add it to the variable.
  5. Click OK.
  6. The Exposure variable group now includes Spinach, which appears in the Variable Definitions textbox within the Defined Variables gadget.

 

Delete Variable

The Delete Variable option in the Defined Variables gadget removes a defined variable from the system. In this example, the Exposure group variable will be deleted.

  1. On the left-hand side of the Visual Dashboard canvas, move the mouse cursor over the Defined Variables gadget, or click the Variables icon at the top left of the screen. The gadget expands and becomes fully visible.
  2. Select the Exposure variable definition within the textbox.
    Variable Definitions box, illustrating Delete Variable option

    Figure 8.88: Variable Definitions box, illustrating Delete Variable option

     

  3. Click on the Delete Variable button.
  4. The variable is deleted from the Variable Definitions text box.

Page last reviewed: September 16, 2022, 12:00 pm