Fits terms from a `REML`

fixed model in a Genstat regression (R.W. Payne).

### Options

`PRINT` = string tokens |
Controls printed output (`model` , `deviance` , `summary` , `estimates` , `correlations` , `fittedvalues` , `accumulated` ); default `mode` , `summ` , `esti` , `accu` |

`FACTORIAL` = scalar |
Limit for expansion of terms; default 3 |

`DENOMINATOR` = string token |
Whether to base ratios in accumulated summary on rms from model with smallest residual ss or smallest residual ms (`ss` , `ms` ); default `ss` |

`SELECTION` = string tokens |
One or two criteria to be printed with the models (`%variance` , `%ss` , `adjustedr2` , `r2` , `dispersion` , `aic` , `sic` , `bic` ); default `%var` , `aic` , `sic` |

### Parameter

`TERMS` = formula |
Fixed terms to be dropped |

### Description

VRFIT is one of several procedures designed to improve the process of determining the appropriate fixed terms to include in a `REML`

analysis. (The others are `VRADD`

, `VRDROP`

, `VRDISPLAY`

, `VRKEEP`

, `VRSETUP`

, `VRSWITCH`

and `VRTRY`

.) They do this by a generalized regression analysis, with a weight matrix based on variances estimated from the original `REML`

analysis (with the full fixed model). You can use the mean square of the current model to assess each change as in ordinary regression. However, as this is a weighted regression, the mean square from the full fixed model is one. A convenient alternative might therefore be to use this mean square (of one), to assess the terms with the same measure of random variation as in analysis of variance. (Conversely, if you were to assess the fixed model by changing the fixed model in a sequence of `VCOMPONENTS`

commands, the fixed terms that are not fitted will be included in the random variation. This will then vary from fit to fit, making it difficult to reach a clear and consistent conclusion.) Having used these procedures to decide on the important fixed terms, you can use `VPREDICT`

to form predicted means.

Before fitting the terms, the `VRSETUP`

procedure must be called to make some checks, and initialize the regression by specifying a `MODEL`

command with the necessary weight matrix and a `TERMS`

command with the full fixed model. It also uses the `WORKSPACE`

directive to set up a Genstat workspace structure to store control information and results. `VRFIT`

will call `VRSETUP`

for you, if you have not done so already. The analysis will then be based on the most recent `REML`

analysis. To use an earlier analysis, you should call `VRSETUP`

yourself, setting its SAVE option set to the save structure of the required `REML`

analysis.

The terms to be fitted are specified by the `TERMS`

parameter, in a similar way to the `FIT`

directive. The `FACTORIAL`

option sets a limit (by default 3) on the number of factors and variates in each term. Terms containing more than that number are omitted.

The `PRINT`

option controls printed output as in the regression directives, except that some irrelevant settings are omitted. (For example, `grid`

is relevant only to the fitting of nonlinear models.) See `VRDISPLAY`

for more details.

The `DENOMINATOR`

option specifies how the residual is selected for the accumulated analysis of variance By default it is taken from the model with the smallest number of residual degrees of freedom. However, you can set `DENOMINATOR=ms`

to take it from the model with the smallest residual mean square.

The `SELECTION`

option specifies the statistics to be displayed in the summary of analysis as in the regression directives, except that again some irrelevant settings are omitted. See `VRDISPLAY`

for more details.

Options: `PRINT`

, `FACTORIAL`

, `DENOMINATOR`

, `SELECTION`

.

Parameter: `TERMS`

.

### Method

`VRFIT`

calls the `VRSETUP`

procedure to initialize the regression, if this has not been done already. It then uses the directives `FIT`

and `ADD`

to fit the terms one at a time, storing the results in the workspace together with the denominator degrees of freedom for each term if available from the original `REML`

analysis. (It is the need to use the `REML`

denominator degrees of freedom regression for the terms, instead of the residual degrees of freedom from the regression, that prevents you from using the regression commands directly.) Finally, `VRFIT`

calls `VRDISPLAY`

to print the results.

### Action with `RESTRICT`

Any restriction applied to vectors used in the `REML`

analysis will apply also to the results from `VRFIT`

.

### See also

Directives: `FIT`

, `REML`

.

Procedures: `VRADD`

, `VRDROP`

, `VRDISPLAY`

, `VRKEEP`

, `VRSETUP`

, `VRSWITCH`

, `VRTRY`

, `VALLSUBSETS`

, `VSCREEN`

.

Commands for: REML analysis of linear mixed models.

### Example

CAPTION 'VRFIT example',\ 'Example 5.3.6 from The Guide to Genstat, Part 2 Statistics';\ STYLE=meta,plain FACTOR [NVALUES=322; LEVELS=27] Dam & [NVALUES=322; LEVELS=18] Pup FACTOR [NVALUES=322; LEVELS=2; LABELS=!T('M','F')] Sex FACTOR [NVALUES=322; LEVELS=3; LABELS=!T('C','Low','High')] Dose VARIATE [NVALUES=322] Littersize,Weight OPEN '%GENDIR%/Examples/GuidePart2/Rats.dat'; CHANNEL=chan READ [CHANNEL=chan] Dose,Sex,Littersize,Dam,Pup,Weight; \ FREPRESENTATION=2(labels),4(levels) CLOSE chan VCOMPONENTS [FIXED=Littersize+Dose*Sex] RANDOM=Dam/Pup REML [PRINT=model,components,wald] Weight VRFIT [PRINT=estimates,accumulated] Littersize+Sex*Dose