1. Home
  2. LVARMODEL procedure

LVARMODEL procedure

Analyses a field trial using the Linear Variance Neighbour model (D.B. Baird).


PRINT = string tokens Controls printed output (data, effects, sed, residuals, variances); default effe, sed, vari
METHOD = string token Indicates which version of the LV model to use (full, reduced); default full
LAMBDA = scalar Number between 0 and 1 which defines the value for the variance parameter λ (if METHOD=full and LAMBDA=0, the value is estimated by REML); default 0
VARMETHOD = string token Specifies which estimator of residual variance to use to calculate the sed’s of treatment effects (RMS2, GLS) default RMS2
TOLERANCE = scalar Defines the precision to which the variance parameter λ should be estimated; default 0.01


Y = variates Y-values (usually plot yields) row by row
TREATMENTS = factors Treatment factor for each y-variate
BLOCKS = factors Block factor, defining groups of plots to be de-trended independently
UNITS = factors Unit-within-block factor, defining the order of plots within each block
EFFECTS = tables Saves the estimated treatment effects from each analysis
SED = matrices or symmetric matrices Saves the estimated standard errors of differences between treatments
WNOISE = variates Saves the estimated white noise component
TREND = variates Saves the estimated trend component
COMPONENTS = variates Saves the estimated variance components: the tuning parameter λ, and either the variance of the random walk innovations (λ<0.9) or the white noise variance (λ≥0.9)


LVARMODEL analyses a field trial, whose plots are in lines of equal length, using the Linear Variance (LV) Neighbour analysis (Williams 1986). The LV model is equivalent to the extended First Difference model of Besag & Kempton (1986). The model allows for local trends within a row, and the analysis attempts to remove these trends by using a form of smoothing. In the full LV model, the degree of smoothing is estimated from the data; alternatively the reduced model, corresponding to the ordinary First Difference (FD) model of Besag & Kempton (1986), applies a full linear de-trending to the data.

The LV model specifies the data as the sum of three components: the treatment effects, a trend component which is a random walk process, and a residual white noise component. The full Linear Variance plus Incomplete Block model of Williams (1986) has an additional random component for incomplete blocks, These can be fitted as a fixed effect, by treating each block as a separate line of plots.

The variable to be analysed (normally a plot yield) is specified in a variate, using the Y parameter. The factor defining the treatments on the plots is specified using the TREATMENTS parameter. The BLOCKS parameter specifies the block factor, defining the groups of plots that are to be de-trended separately, and the UNITS parameter specifies the units-within-blocks factor defining the order of the plots within each block. For example, if the plots are on a rectangular grid and trends are to be removed along rows, the BLOCKS and UNITS factors would be the row and column factors, respectively. If BLOCKS and UNITS are not set, the plots are assumed to be in a single line (and specified sequentially down the line). The procedure can handle missing values in the y-variate but not in the TREATMENTS, BLOCKS or UNITS factors.

The other parameters allow information to be saved from the analysis: EFFECTS for the table of estimated treatment effects; SED for the standard errors of differences between treatments effects (in either a matrix or a symmetric matrix); WNOISE for the estimated white noise (in a variate); TREND for trend component (in a variate); and COMPONENTS for the two variance parameters. The first variance component is the parameter λ. For λ<0.9 the second component is the variance of the innovations in the random walk. If λ≥0.9 the second component saved is the variance of the white noise component, as the random walk component disappears in the limit as λ tends to one.

Printed output is controlled by the PRINT option with the following settings: data – y-values and treatments in a tabular form; effects estimated treatment effects; sed standard errors of differences of effects; variance estimates of λ and the white noise variance; and residuals trend and white noise components.

The METHOD option controls the form of LV model to be fitted. By default setting of full causes the full LV model to be fitted, with the variance parameters of the model estimated by Residual Maximum Likelihood (REML); see Gleeson & Cullis (1987). The variance parameters used, λ and κ, are those given by Baird and Mead (1991). The parameter λ is known as the tuning parameter, as it controls the degree of smoothing used in eliminating trend effects from the data. It is related to the parameter α of Besag & Kempton (1986), by the relationship

λ = α / (1 + α)

Alternatively, specifying METHOD=reduced fits the reduced form of the LV model, that is the FD model. This is equivalent to putting λ = 0.

The option LAMBDA allows the value of the tuning parameter to be set at a fixed value, which must lie between 0 and 1. By default LAMBDA=0, which for METHOD=full causes the value to be estimated as described above.

The option VARMETHOD controls the estimator used for the estimating the variance of the residual white noise component. There are two possibilities: the normal generalized least-squares estimator GLS, and an estimator based on the second differences of the errors RMS2 (Besag & Kempton 1986). The simulation study of Baird & Mead (1991) showed the standard errors of treatment effects based on RMS2 to be approximately valid under randomization for a wide range of error models. When the estimated value of λ was not close to zero, the standard errors based on GLS were found to be approximately unbiased and more efficient than those based on RMS2 for the LV model. However the standard errors based on GLS could be seriously biased in some situations for the FD model or when λ was close to zero. Thus the default for VARMETHOD is RMS2.

Finally, the TOLERANCE option specifies the precision to which λ should be estimated.




The model is fitted in a similar manner to that outlined in Besag & Kempton (1986), but the variance components have the parameterization used by Baird & Mead (1991) and are fitted by residual maximum likelihood (Gleeson & Cullis 1987) rather than maximum likelihood; also see Baird (1987). The optimization of the likelihood is done by golden section search on the profile likelihood for λ. Residuals are constructed by creating the smoothing matrix S that corresponds to the LV model fitted (Green et al. 1985).

The procedure uses a large amount of data space and computer time when the tuning parameter is estimated by REML. The speed is proportional to the number of rows multiplied by the square of the numbers of columns.

Action with RESTRICT

The procedure ignores any restrictions, for example, on Y, TREATMENTS, BLOCKS and UNITS.


Baird, D.B. (1987). A Genstat 5 procedure for a First Difference analysis. Genstat Newsletter, 19, 40-47.

Baird, D.B. & Mead, R. (1991). The empirical efficiency and validity of two neighbour models. Biometrics, 47, 1473-1487.

Besag, J.E. & Kempton R.A. (1986). Statistical analysis of field experiments using neighbouring plots. Biometrics, 42, 231-251.

Gleeson, A.C. & Cullis, B.R. (1987). Residual maximum likelihood estimation of a neighbour model for field experiments. Biometrics, 43, 277-288.

Green, P.J., Jennison, C. & Seheult. A.H. (1985). Analysis of field experiments by least squares smoothing. Journal of the Royal Statistical Society, Series B, 47, 299-315.

Williams, E.R. (1986). A neighbour model for field experiments. Biometrika, 73, 279-287.

See also

Directive: VSTRUCTURE.

Commands for: REML analysis of linear mixed models.


CAPTION 'LVARMODEL example',!t(\
        'The data (Jenkyn et al. 1979, Annals of Applied Biology, pp.',\
        '11-28) are a series of Barley yields from a row of 38 plots',\ 
        'which had four fungicide spray treatments applied',\ 
        '(0 = None, 1 = One spray, 2 = Two sprays, R = Repeated sprays).');\ 
        !( 5.77,5.73,6.08,5.26,5.89,5.37,5.95,5.95,5.59,5.16,5.89,6.14,6.01,\
           6.18,6.43,5.82,6.47,5.73,6.54,5.99,5.76,5.04,4.38,5.06,5.13 )
FACTOR  [Labels=!T('0','1','2','R');NVALUES=38] Treat; VALUES=\ 
        !( 4,   3,   4,   1,   2,   1,   3,   4,   2,   1,   2,   3,   4,\   
           3,   2,   4,   1,   4,   1,   3,   2,   3,   1,   2,   4,   2,\   
           4,   3,   1,   3,   1,   4,   2,   3,   2,   1,   4,   3 )
CAPTION 'Fit the Reduced LV model - First Difference model.'
CAPTION 'Fit the Full LV model with precision of estimation for lambda 0.005'
Updated on March 7, 2019

Was this article helpful?