aovSar.gen: Using a SAR model to handle spatial dependence in an aov...

Description Usage Arguments Details Value References Examples

View source: R/aovSar.gen.R

Description

Fit a completely randomized design when the experimental units have some degree of spatial dependence using a Spatial Lag Model (SAR).

Usage

1
aovSar.gen(formula, coord, seq.radius, data = NULL)

Arguments

formula

A formula specifying the model.

coord

A matrix or data.frame of point coordinates.

seq.radius

A complex vector containing a radii sequence used to set the neighborhood pattern. The default sequence has ten numbers from 0 to half of the maximum distance between the samples.

data

A data frame in which the variables specified in the formula will be found.

Details

Three assumptions are made about the error in the analysis of variance (ANOVA):

1. the errors are normally distributed and, on average, zero;

2. the errors all have the same variance (they are homoscedastic), and

3. the errors are unrelated to each other (they are independent across observations).

When these assumptions are not satisfied, data transformations in the response variable are often used to circumvent this problem. For example, in absence of normality, the Box-Cox transformation can be used.

However, in many experiments, especially field trials, there is a type of correlation generated by the sample locations known as spatial correlation, and this condition violates the independence assumption. In this setting, this function provides an alternative for using ANOVA when the errors are spatially correlated, by using a data transformation discussed in Long (1996)

Y_{adj} = Y - (\hat{ρ}WY - \hat{ρ}β_0),

where \hat{ρ} denotes the autoregressive spatial parameter of the SAR model estimated by lagsarlm, β_0 is the overall mean and W is a spatial neighborhood matrix which neighbors are defined as the samples located within a radius, this radius is specified as a sequence in seq.radius. For each radius in seq.radius the model is computed as well its AIC, then the radius chosen is the one that minimizes AIC.

The aim of this transformation is converting autocorrelated observations into non-correlated observations in order to apply the analysis of variance and obtain suitable inferences.

Value

aovSar.gen returns an object of class "SARaov". The functions summary and anova are used to obtain and print a summary and analysis of variance table of the results. An object of class "SARaov" is a list containing the following components:

DF

degrees of freedom of rho, treatments, residual and total.

SS

sum of squares of residuals and total.

residuals

residuals of the adjusted model.

MS

mean square of residuals and total.

rho

the autoregressive parameter.

Par

data.frame with the radius tested and its AIC.

modelAdj

model of class aov using the adjusted response.

modelstd

data frame containing the ANOVA table using non-adjusted response.

namey

response variable name.

References

Long, D. S. "Spatial statistics for analysis of variance of agronomic field trials." Practical handbook of spatial statistics. CRC Press, Boca Raton, FL (1996): 251-278.

Rossoni, D. F.; Lima, R. R. . Autoregressive analysis of variance for experiments with spatial dependence between plots: a simulation study. Revista Brasileira de Biometria, 2019

Scolforo, Henrique Ferraço, et al. "Autoregressive spatial analysis and individual tree modeling as strategies for the management of Eremanthus erythropappus." Journal of forestry research 27.3 (2016): 595-603.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data("crd_simulated")
coord <- cbind(crd_simulated$coordX, crd_simulated$coordY)
cv <- aovSar.gen(y ~ trat, coord, data = crd_simulated)
cv

#Summary for class SARanova
summary(cv)

#Anova for class SARanova
anova(cv)

lrcastro/spANOVA documentation built on Aug. 21, 2019, 11:45 a.m.