A variable set is a grouping of one or more related variables. It may consist of a single variable (e.g., a variable measuring the age of people in a Data Set), or it may consist of multiple related variables (e.g., the age of people within a household, where there is one variable for each person).
The variable sets in a Data Set are shown in the Data Sets Tree in Displayr and in the Variables and Questions tab in Q.
A variable refers to the data contained within a single column in the Data tab in Q or Data Editor in Displayr, and equivalently, an item in the Data Sets Tree in Displayr, and the Variables and Questions tab in Q.
A Variable Set has the following properties:
- Variable Set Name
- A set of variables that are in the variable set. Note that while a variable can only appear once in a variable set, it can be copied multiple times so this restriction is more of an organizing principle than a constraint.
- Variable Set Structure in Displayr, or Question Type in Q
- In Q, each variable has a Variable Type.
- Value Attributes
- Data Reduction
A variable set has a number of roles:
- It is a way of organizing data.
- It expedites selection and referencing of data with code. For example, if a variable set consists of 100 variables, they can be collectively referred to by their Variable Set Name.
- It determines how variables are used when constructing tables and their associated statistical tests (see Table). See Variable Set Structure for more information.
Setting and modifying
Variable Sets are inferred when importing data into Displayr and Q. They are modified using the options in the Object Inspector and by using the options in the toolbar in Displayr, or via the Variables and Questions tab, including right-clicking on the variable set.