3 Variable Types in Rguroo

A dataset in Rguroo consists of rows (cases) and columns (Variables). Each variable in Rguroo is classified as one of Numerical, Nominal, Ordinal, or Label/ID. Within the application dialog boxes in Rguroo, Nominal and Ordinal variables are identified as Factors.

3.1 Default Variable Types

When you upload a dataset to Rguroo, the variables are initially classified as one of Numerical, Nominal, or Label/ID. However, as we will explain shortly, it is possible to change the variable types within the application. The default classifications are as follows:

  • Variables with only numerical values are classified as Numerical Variables.
  • If a variable doesn’t consist entirely of numerical values, it will be classified as Nominal, except in the following cases where it will be classified as Label/ID:
  • If a variable has more than 1000 levels.
  • If a dataset has more than 50 cases, and the variable has the same number of levels as the number of cases (i.e., there is a unique ID for each case).

When you create a new dataset using Rguroo’s dataset editor, by default, a column with no values entered is classified as Numerical. If you only enter numerical values or “NA” (which represents missing data) in that column, the variable type will remain Numerical. However, as soon as you enter a non-numeric character (such as a letter or symbol) in any cell within that column, the variable type will automatically change to Nominal.

3.2 Changing Variable Types

To change variable types, you can either use Rguroo’s dataset editor, or Rguroo’s variable type editor.

Double-click on the name of the dataset to open it in Rguroo’s dataset editor. Then, click on the Row column icon icon to open the Variable and Row Management dialog. Then select the variable that you want to change its type, and select from one of Numerical, Nomina, Ordinal, or Label/ID.

Variable and Row Management Dialog

Figure 3.1: Variable and Row Management Dialog


To change the variable type using the Variable Type Editor, begin by right-clicking on the name of your dataset to open the Variable Type Editor dialog. From there, you can select the variable that you want to change its type and drag it to one of three options: Numerical,, Label/ID, or Factor/categorical(which can be seen in the dialog box shown below). If you want to classify a categorical variable as ordinal, you can select the checkbox labeledOrdinal. If you do not select this checkbox, the categorical variable will be classified as Nominal. When done with your changes, click the update button button.

Variable and Row Management Dialog

Figure 3.2: Variable Type Editor

Rules to Keep in Mind When Changing Variable Types

  • If a dataset has dependencies (i.e., has been used in another Rguroo function), you cannot change the variable types. This ensures that the functions that you have applied to the dataset are reproducible.

  • Any Numerical variable can be changed to Nominal, Ordinal, or Label/ID.

  • Any Numerical, Nominal, or Ordinal variable can be changed to Label/ID.

  • Any Nominal, Ordinal, or Label/ID variable that consists of all numerical values can be changed to Numerical.

  • Finally, it’s important to note that any variable that has non-numeric characters cannot be changed to numerical.

3.3 Managing Levels of a Factor (Categorical) Variable

You can relabel and reorder levels of a factor variable. This can be done either in Rguroo’s Dataset Editor or in the Variable Type Editor (see images in the previous subsection).

To reorder levels in the Dataset Editor use the following steps:

Option 1: Relabeling and Reordering Levels

  1. Double-click on the name of the dataset to open the dataset in the Rguroo editor.

  2. Click on the Row column icon icon to open the Variable and Row Management dialog.

  3. Select Variable Properties.

  4. Select a nominal or ordinal variable form the Variable list.

  5. Click on the level editor button button to open the Level Editor dialog. See image below for an example.

  6. To reorder levels of the variable, select a variable and drag it up or down.

  7. To relabel a level, Type in the new label in the label column. The name of a level is the default for its label.

Level Editor

Figure 3.3: Level Editor

3.4 Missing Data

In Rguroo, the letters “NA” (capitalized) are reserved for representing missing data, which is consistent with the notation used in the R computing language. If you want to remove cases with missing values from variables that are classified as Nominal or Ordinal, you can select the Exclude NA checkbox either in the Variable Type Editor dialog or in the Level Editor dialog within the Variable and Row Management dialog. See the previous subsections for how to access these dialog boxes.

The letters “NA” (capitalized) is reserved for missing data in Rguroo. This is in keeping with the notation that is used in the R computing language. In order to remove cases with missing values from variables classified as Nominal or Ordinal, you can select the checkbox Exclude NA in either the Variable Type Editor or in the Level Editor within the Variable and Row Management dialog.