1. Home
  2. Restrict to a Random Subset of Rows

Restrict to a Random Subset of Rows

Select menu: Spread | Restrict/Filter | Random Rows

Use this to apply a restriction to the spreadsheet using a random subset of rows. The number or percentage of rows is specified and then rows are excluded to leave a random selection containing this number of rows. If the spreadsheet is currently restricted then it, will be removed before selecting the rows for the new restriction.

  1. From the menu select Spread | Restrict/Filter | Random Rows.

Restrict to a random subset of rows using

Number of rows When selected, this specifies the number of rows that are to be included in the restriction. The value must be an integer between 1 and the total number of rows minus one.
Percentage of rows When selected, this specifies the percentage of the total number of rows in the spreadsheet to use in the restriction. The percentage must be between 0 and 100%, however to avoid all or no rows being selected the values 0 and 100 cannot be used.

Subset on update

When selected, the update menu items on the Spread menu will only submit a subset of the data based on any restriction that has been applied. If any rows have been restricted then these will be submitted to the Genstat server creating a (unrestricted) subset including just those rows. Any factors updated in this way will have any unused levels/labels excluded so, for example, they will not appear in tables of means, etc. Any change to data in the restricted rows will enforce an update of all the columns in the spreadsheet to the Genstat server. When this option is activated the row numbers are displayed in the colour used for restricted items (the default colour is red) to indicate this mode.

Note

Restrictions can be applied to matrices and tables, although these data structures cannot be restricted within the Genstat server. If the Subset on update option is selected, then a reduced matrix with restricted rows removed will be updated to the server. Otherwise the restrictions within the spreadsheet will be used for display purposes only and the full data will always be updated to the server.

See also

Spreadsheet Restrict/Filter Menu for other methods of defining restrictions.

The RESTRICT directive can be used to filter columns within the command language.

Updated on March 14, 2019

Was this article helpful?