Three assumptions are made about the error in the analysis of variance (ANOVA):
1. The errors come from a normal distribution.
2. The errors have the same variance.
3. The errors are uncorrelated.
However, in many experiments, especially field trials, there is a type of correlation
generated by the sample locations known as spatial autocorrelation, and this condition
violates the independence assumption.
In that way, we need to regard this spatial autocorrelation and include it in the final
model. It could be done adopting a geostatistical model to characterize the spatial
variability among the observations directly in the covariance matrix.
The geostatistical modeling is based on the residuals of the standard model
(where the errors are assumed to be independent, uncorrelated and having a normal
distribution with mean 0 and constant variance). The basic idea is using them to
estimate the residuals of the spatially autocorrelated model in order to fit a
theoretical geostatistic model to build the covariance matrix.
As Pointed by Pontes & Oliveira (2004), this task can be done using the
following algorithm
1 - Extract the residuals from the standard model
2 - Fit a variogram based on residuals obtained in step 1.
3 - Fit a theoretical model to describe the spatial dependence observed in the variogram.
4 - On basis in the theoretical model fitted in step 3 and its parameter estimates,
create the covariance matrix.
5 - Estimate the residuals using the covariance matrix obtained in step 4 and use
them to create a variogram.
6 - Fit a theoretical model to the residual variogram obtained in step 5 and use
its parameters estimates to build a new covariance matrix.
7 - Repeat 5 to 6 until convergence.
Step 1 is implemented in spVariog. Steps 2 and 3 are implemented in spVariofit.
aovGeo implements steps 4 to 7 and needs a cutoff argument to define the maximum
distance in the computation of the residual variogram described in step 6
In presence of spatial trend, the model is modified
in order to include the effect of the spatial coordinates.