10.7 Variable Categories
You can use variable categories to help organize long lists of variable definitions in a tree. Use the Variables View to create a hierarchical structure of variables via variable categories.
The categories can be used both in the display of variable definitions in the tree window (under nodes), as well as in the Variables View.
We will use the Healthcare tutorial example tree CE-MarkovModel.trex as an example, but you can follow these steps in any model. We will categorize the variables cLocal, cLocal1 and cLocal2 under the category "Payoffs" and the pLocalToDead, pLocalToDead1 and pLocalToDead2 under the category "Probabilities".
To create a variable category:
-
Click the "Show Categories Tree" button (left of the Clear button). The categories pane within the view will be displayed to the left of the variables list.
-
Click the "plus" icon in the categories pane. A new category "Category1" will be created.
-
Click the new category in the categories grid and rename it. In this case, enter "Payoffs".
-
Repeat the prior two steps to create the category "Probabilities".
Once the categories have been created, you can assign each variable to one or more categories by dragging the variable onto the category name to the left. You can also assign categories via Categories property category within the Add/Change Variable Dialog - when you are creating or editing the variables - using the Edit Variable function.
The Variables View then shows the categories assigned to each variable. Note that the "Group items by category" toggle icon is also depressed in the Variable View toolbar. In the table, the Category column lets you select which category to place the variable in.
You can create a hierarchical structure of variable categories by creating subcategories within other categories using the "Add sub-category" icon in the categories pane. Variables can be assigned to one or more categories, regardless of each category's position in the hierarchy. To assign variables to sub-categories, drag the variable from the main window into the subcategory. The categories and sub-categories the variables are listed in will appear in the Category column in the main Variable View pane.
Categories for other inputs
Categories are most-commonly used for variables. However, other model inputs (distributions, trackers, tables) can also be categorized in the same way.
Variable Category Tree Preferences
The tree’s variables display preferences allow you to display variable definitions in the model by category. When checked, the tree shows categories for variable definitions under each node. The image below shows Tree Preferences, with the model in the background and the categories for Payoffs and Probabilities.
Variable Categories in the Variable Report
If variable categories are used in the model then the variable report will also show the categories including any subcategories, as in the Figure below.
If you select to "Group items by categories" in the Variable view before generating the Variable Report, the Variable Report will show the variables grouped by categories too.t.