1. Home
  2. FREGULAR procedure

FREGULAR procedure

Expands vectors onto a regular two-dimensional grid (R.W. Payne).

Options

ROWS = factor Original row factor
COLUMNS = factor Original column factor
NEWROWS = factor New row factor expanded onto the full grid
NEWCOLUMNS = factor New column factor expanded onto the full grid
SORT = string token Whether to sort the new values into row × column order (yes, no); default no

Parameters

OLDVECTOR = variates, factors or texts Original data vectors
NEWVECTOR = variates, factors or texts New vector with values, provided by the VALUES parameter, inserted in the units added to complete the grid
VALUES = variates, scalars or texts Values to insert in the units added to complete the grid; default is to insert missing values

Description

FREGULAR is useful when you have data that have been recorded on a regular but incomplete two-dimensional grid: i.e. a you have rectangular grid of positions where observations could have been made but, at some of the points, nothing has been recorded.

An incomplete grid has disadvantages, for example, if you want to use REML to fit a spatial covariance model to one of the data variates. With data on a complete grid, you can fit various types of separable covariance model but, with an incomplete grid, only power distance-models are available (see VSTRUCTURE for details). So, if there are only a few empty positions, you might want to fill them in with missing values, and then set option MVINCLUDE = explanatory, yvariate in the REML command to include (and adjust for) these units in the analysis. Missing values are the default. Alternatively, if you know the values to insert, you can supply them using the VALUES parameter. You can supply a single value (in a scalar or a single-valued text, according to the type of the OLDVECTOR) if the new values are all the same. If they differ over the added units, they should be specified in row-column order

The ROWS and COLUMNS options supply factors identifying the row and column coordinates of the original data values. Note that, if there is more than one data value at any pair of coordinates, additional units are added so that there is the same number of units at each point. The NEWROWS and NEWCOLUMNS options can save factors with the new row and column coordinates, where additional units have been added to complete the grid.

The OLDVECTOR parameter specifies the original data vectors (variates, factors or texts). The NEWVECTOR parameter can supply the identifiers of vectors to store the new values (with missing values in the units added for the previously empty positions). If no NEWVECTOR is specified for an OLDVECTOR, the new values replace those in the OLDVECTOR.

By default, the units are left in their original order, with the new units added at the end. However, you can set option SORT=yes to sort them into ascending row × column order.

Options: ROWS, COLUMNS, NEWROWS, NEWCOLUMNS.

Parameters: OLDVECTOR, NEWVECTOR, VALUES.

Action with RESTRICT

Any restrictions are ignored.

See also

Commands for: Calculations and manipulation.

Example

CAPTION       'FREGULAR example'; STYLE=meta
SPLOAD        '%gendir%/data/slatehall.gsh'
" remove some edge plots so that the row x column grid is no longer complete "
SUBSET        [plotnumber.NI.!(15,30...75,141...150)]\
              fieldrow,fieldcolumn,variety,yield;\
              NEWVECTOR=missrows,misscols,missvariety,missyield
FREGULAR      [ROWS=missrows; COLUMNS=misscols;\
              NEWROWS=fullrow; NEWCOLUMNS=fullcol; SORT=yes]\
              missvariety,missyield; NEWVECTOR=fullvariety,fullyield
PRINT         fieldrow,fullrow,fieldcolumn,fullcol,\
              variety,fullvariety,yield,fullyield; FIELD=2(9),12,8,8,12,8,9
Updated on March 7, 2019

Was this article helpful?