1. Home
  2. VARECOVER procedure

VARECOVER procedure

Recovers when REML, is unable to fit a model, by simplifying the random model (R.W. Payne).


PRINT = string tokens Controls what summary output is produced about the simpler random models that are tried (deviance, aic, bic, sic, dffixed, dfrandom, change, exit, best); default devi, aic, sic, dfra, best
PBEST = string tokens Controls the output from the REML analysis with the best simpler model (model, components, effects, means, stratumvariances, monitoring, vcovariance, deviance, Waldtests, missingvalues, covariancemodels, aic, sic, bic); default * i.e. none
PTRY = string tokens Controls the output to present to present from the REML analysis used to try each model (model, components, effects, means, stratumvariances, monitoring, vcovariance, deviance, Waldtests, missingvalues, covariancemodels, aic, sic, bic); default * i.e. none
PLOTFACTOR = factor Factor numbering the plots in the design, required if VARECOVER needs to try a null random model; if unset, a local factor is defined automatically
FORCED = formula Specifies terms that must not be removed from the random model; by default any of the random terms can be removed
PTERMS = formula Terms (fixed or random) for which effects or means are to be printed; default * implies all the fixed terms
PSE = string token Standard errors to be printed with tables of effects and means (differences, estimates, alldifferences, allestimates, none); default diff
MVINCLUDE = string tokens Whether to include units with missing values in the explanatory factors and variates and/or the y-variates (explanatory, yvariate); default * i.e. omit units with missing values in either explanatory factors or variates or y-variates
METHOD = string token Criterion to choose the best model (aic, sic, bic); default sic
PROHIBIT = string token Whether to exclude models where any estimated variance parameters are held at a bound (bound); default *


Y = variates Response variates
MODELSTRUCTURE = pointers Model-definition structure for the unsuccessful analysis of each y-variate
BESTMODEL = pointers Saves a model-definition structure for the best model for each y-variate
EXIT = scalars Exit status of the best model for each y-variate
SAVE = REML save structures Save structure from the analysis of the best model for each y-variate


VARECOVER can be used to recover after an unsuccessful attempt to fit a REML model. Usually this can be resolved by omitting non-significant random terms – there may be too little information about these term in the REML likelihood for the algorithm to find the optimum. VARECOVER automates the process of finding a simpler model that can be fitted successfully. First it tries random models that omit one term from the random model (and if there is a correlation model defined on the omitted random term, that will be omitted too). Then, if none of these models can be fitted, it tries models that omit two random terms, and so on, until eventually a null random model may have to be fitted. If there is more than one candidate model available from those that omit the same number of random terms, VARECOVER chooses the one with the smallest Akaike or Schwarz (Bayesian) information coefficient, according to the setting of the METHOD option. If you set option PROHIBIT = bound, VARECOVER excludes models with any estimated variance parameters held at a bound: i.e. the fitting of these models is also regarded as unsuccessful. You can also use the FORCED option to specify any terms that must not be dropped from the random model (e.g. because you want to estimate their BLUPs).

The PRINT option specifies the summary output to be produced about the models that are tried. The settings are mainly the same as those of the VRACCUMULATE procedure (which is used to store and then print the information). However, there is also a setting, best, to print the description of the best model (i.e. the simplified model that has been chosen). By default, PRINT=best.

The PBEST option specifies the output to be produced from the REML analysis with the best model. Similarly, the PTRY option indicates what output should be produced for each candidate random model when it is tried. Their settings are mainly the same as those of the PRINT option of the REML directive. There are also extra settings aic and sic (with a synonym bic) to print the Akaike and Schwarz (Bayesian) information coefficients, respectively. The default for both these options is to produce no output.

The PTERMS option operates as in REML, to specify the terms whose means and effects are printed by PBEST and PTRY; the default is all the fixed terms. Likewise, the PSE option controls the type of standard error that is displayed with the means and effects; the default is to give a summary of the standard errors of differences.

The PLOTFACTOR option allows you to specify a factor to index the plots, which will used if it is necessary to try the null random model. If this is not set, a local factor called plots is set up automatically.

The MVINCLUDE option controls whether units with missing values in the explanatory factors and variates and/or the y-variate are included in the analysis, as in the REML directive.

The Y parameter specifies the response variate, and the MODELSTRUCTURE parameter specifies a model-definition structure defining the model used in the unsuccessful REML analysis. A model-definition structure for the best of the simplified models can be saved, in a pointer, by the BESTMODEL parameter; the VMODEL procedure can use this to define the model (using the VCOMPONENTS and VSTRUCTURE directives) so that you can reanalyse it yourself using the REML directive. Alternatively, you can save the REML save structure from the analysis with the best model by using the SAVE parameter. The EXIT parameter can save a scalar containing the REML exit status of the best model for each y-variate; see VKEEP for details.




Model definition structures are defined for the various candidate models. The VARANDOM procedure is used to fit them, with the VRACCUMULATE procedure storing the necessary details for the best one to be selected.

See also



Commands for: REML analysis of linear mixed models.


SPLOAD    '%gendir%/examples/Vaseries.gsh'
" analyse data from site G "
SUBSET    [site.IN.'G'] row,column,entry,yield
" try (and fail) to fit a model with row, column and spatial terms "
VFMODEL   [MODEL=RowColumnAndSpatialModel;\
          FIXED=entry] RANDOM=row*column; CONSTRAIN=none
VFSTRUCTURE [MODEL=RowColumnAndSpatialModel; TERM=row.column]\
          ar,ar; FACTOR=row,column; ORDER=1
VMODEL    RowColumnAndSpatialModel
" set run interactive, to avoid example stopping after the REML diagnostic "
SET       [RUN=interactive]
REML      [PRINT=model] yield
" find a simpler random model, that can be fitted successfully "
VARECOVER [PRINT=best,deviance,aic,bic,sic,dfrandom]\
          yield; MODEL=RowColumnAndSpatialModel; BESTMODEL=SimplerRandomModel
VMODEL    SimplerRandomModel
REML      [PRINT=model,components,wald; WORKSPACE=700; FMETH=none] yield
Updated on June 17, 2019

Was this article helpful?