1. Home
  2. Restrict to Groups (factor levels)

Restrict to Groups (factor levels)

You can filter out rows by restricting the spreadsheet to display specific levels of a factor (discrete units within a group).

In the spreadsheet below, the column Drench contains grouped data that specifies how often sheep were given each treatment – Control (no treatment), Once and Twice.

For our example we will restrict the spreadsheet to only display rows where the factor level is ‘Once‘.

  1. From the menu select Spread | Restrict/Filter | To Groups (factor levels).


  2. In the Factor dropdown list select Drench as the factor to filter the data on.
    The Selected levels field will display the levels of your chosen factor.
  3. Select Once to filter the rows using this level. You can select multiple levels by holding down Ctrl while clicking each one.
  4. In the Restriction type section select Include. This tells Genstat to include all rows that contain the selected levels.
  5. Click Apply to perform the restriction or click OK to perform the restriction and close the dialog.

The resulting spreadsheet now displays only the requested subset of rows. The main options on the dialog are explained below

Tips: You can build complex conditions for the restriction by using the Apply button multiple times with the Existing restrictions combine option enabled. For example, specifying the value 20 with Greater than and applying this, then specifying the value 40 with Less than and clicking OK will select units in the range (20,40).

You can also form a restriction based on more than one column: select units for the first column, click Apply, then make restrictions on subsequent columns with the Existing restrictions combine option enabled.

Restriction type Select Include to display rows that match your restriction or Exclude to hide these rows.
Existing restrictions If a spreadsheet is already restricted you can Combine the new restriction with the existing one or Replace the existing restriction.
Show level in list Enter a search term to further restrict the display to a particular group within a level. Select Match case if you want the search to be case sensitive, and specify which attribute to run the search on (labels, levels or ordinals).
Remove all  Remove all current restrictions on the spreadsheet.
Updated on December 14, 2018

Was this article helpful?