SpATS.nogeno | R Documentation |

Two-dimensional smoothing of scattered data points with tensor product P-splines.

```
SpATS.nogeno(
response,
spatial,
fixed = NULL,
random = NULL,
data,
family = gaussian(),
offset = 0,
weights = NULL,
control = list(maxit = 100)
)
```

`response` |
a character string with the name of the variable that contains the response variable of interest. |

`spatial` |
a right hand |

`fixed` |
an optional right hand |

`random` |
an optional right hand |

`data` |
a data frame containing the variables. |

`family` |
object of class |

`offset` |
an optional numerical vector containing an a priori known component to be included in the linear predictor during fitting. |

`weights` |
an optional numerical vector of weights to be used in the fitting process. By default, the weights are considered to be one. |

`control` |
a list of control values. |

This function is a modified version of the function `SpATS`

in the package `SpATS`

. The difference is that genotypes have been removed.

A list with the following components:

`call` |
the matched call. |

`data` |
the original supplied data argument with a new column with the weights used during the fitting process. |

`model` |
a list with the model components: response, spatial, fixed and/or random. |

`fitted` |
a numeric vector with the fitted values. |

`residuals` |
a numeric vector with deviance residuals. |

`psi` |
a two-length vector with the values of the dispersion parameters at convergence. For Gaussian responses both elements coincide, being the (REML) estimate of dispersion parameter. For non-Gaussian responses, the result depends on the argument |

`var.comp` |
a numeric vector with the (REML) variance component estimates. This vector contains the variance components associated with the spatial trend, as well as those related with the random model terms. |

`eff.dim` |
a numeric vector with the estimated effective dimension (or effective degrees of freedom) for each model component (spatial, fixed and/or random). |

`dim` |
a numeric vector with the (model) dimension of each model component (spatial, fixed and/or random). This value corresponds to the number of parameters to be estimated. |

`dim.nom` |
a numeric vector with the (nominal) dimension of each component (spatial, fixed and/or random). For the random terms of the model, this value corresponds to upper bound for the effective dimension (i.e., the maximum effective dimension a random term can achive). This nominal dimension is |

`nobs` |
number of observations used to fit the model. |

`niterations` |
number of iterations EM-algorithm. |

`deviance` |
the (REML) deviance at convergence (i.e., |

`coeff` |
a numeric vector with the estimated fixed and random effect coefficients. |

`terms` |
a list with the model terms: response, spatial, fixed and/or random. The information provided here is useful for printing and prediction purposes. |

`vcov` |
inverse of the coefficient matrix of the mixed models equations. The inverse is needed for the computation of standard errors. For computational issues, the inverse is returned as a list: C22_inv corresponds to the coefficient matrix associated with the spatial, the fixed and the random components. |

Maria-Xose Rodriguez-Alvarez and Paul Eilers

Rodriguez-Alvarez, M.X, Boer, M.P., van Eeuwijk, F.A., and Eilers, P.H.C. (2018). Correcting for spatial heterogeneity in plant breeding experiments with P-splines. Spatial Statistics, 23, 52 - 71. https://doi.org/10.1016/j.spasta.2017.10.003.

```
# Get the data
library(SemiPar)
data(ethanol)
# Fit the PS-ANOVA model
ps2d <- SpATS.nogeno(response = "NOx",
spatial = ~PSANOVA(E, C, nseg = c(20, 20), nest.div = c(2, 2)),
data = ethanol,
control = list(maxit = 100, tolerance = 1e-05,
monitoring = 0, update.psi = FALSE))
# Report effective dimensions, if desired
# print(summary(ps2d))
# Compute component surface and their sum on a fine grid
Tr = obtain.spatialtrend(ps2d, grid = c(100, 100))
# Plot surface and contours
image(Tr$row.p, Tr$col.p, Tr$fit, col = terrain.colors(100), xlab = 'C', ylab = 'E')
contour(Tr$row.p, Tr$col.p, Tr$fit, add = TRUE, col = 'blue')
points(ethanol$C, ethanol$E, pch = '+')
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.