# Chapter 36 Activity 17: Spatially Continuous Data III

*NOTE*: The source files for this book are available with companion package {isdas}. The source files are in Rmarkdown format and packed as templates. These files allow you execute code within the notebook, so that you can work interactively with the notes.

## 36.1 Practice questions

Answer the following questions:

- What is a correlogram?
- What is the relationship between the autocovariance and the semivariance?
- Describe the elements of a semivariogram.
- Why is it important to consider the number of pairs used in the calculation of the semivariance?

## 36.2 Learning objectives

In this activity, you will:

- Calculate and plot empirical semivariograms.
- Estimate and plot theoretical semivariograms.
- Discuss the results of variographic analysis.

## 36.3 Suggested reading

- Bailey TC and Gatrell AC (1995) Interactive Spatial Data Analysis, Chapters 5 and 6. Longman: Essex.
- Bivand RS, Pebesma E, and Gomez-Rubio V (2008) Applied Spatial Data Analysis with R, Chapter 8. Springer: New York.
- Brunsdon C and Comber L (2015) An Introduction to R for Spatial Analysis and Mapping, Chapter 6, Sections 6.7 and 6.8. Sage: Los Angeles.
- Isaaks EH and Srivastava RM (1989) An Introduction to Applied Geostatistics, Chapter 7. Oxford University Press: Oxford.
- O’Sullivan D and Unwin D (2010) Geographic Information Analysis, 2nd Edition, Chapters 9 and 10. John Wiley & Sons: New Jersey.

## 36.4 Preliminaries

It is good practice to clear the working space to make sure that you do not have extraneous items there when you begin your work. The command in R to clear the workspace is `rm`

(for “remove”), followed by a list of items to be removed. To clear the workspace from *all* objects, do the following:

`rm(list = ls())`

Note that `ls()`

lists all objects currently on the workspace.

Load the libraries you will use in this activity (load other packages as appropriate).

```
library(isdas)
library(gstat)
library(sf)
library(spdep)
library(tidyverse)
```

Load dataset:

`data("aquifer")`

Convert to a simple features object:

`<- st_as_sf(aquifer, coords = c("X", "Y")) aquifer.sf `

The data is a set of piezometric head (watertable pressure) observations of the Wolfcamp Aquifer in Texas (https://en.wikipedia.org/wiki/Hydraulic_head). Measures of pressure can be used to infer the flow of underground water, since water flows from high to low pressure areas.

These data were collected to evaluate potential flow of contamination related to a high level toxic waste repository in Texas. The Deaf Smith county site in Texas was one of three potential sites proposed for this repository. Beneath the site is a deep brine aquifer known as the Wolfcamp aquifer that may serve as a conduit of contamination leaking from the repository.

The data set consists of 85 georeferenced measurements of piezometric head. Possible applications of interpolation are to determine sites at risk and to quantify uncertainty of the interpolated surface, to evaluate the best locations for monitoring stations.

## 36.5 Activity

**NOTE**: Activities include technical “how to” tasks/questions. Usually, these ask you to practice using the software to organize data, create plots, and so on in support of analysis and interpretation. The second type of questions ask you to activate your brainware and to think geographically and statistically.

**Activity Part I**

Obtain and plot the empirical semivariogram for the head in the Wolfcamp Aquifer dataset.

Fit a trend surface of your choice to the Aquifer data set (i.e., polynomial). Then, estimate the residuals and plot an empirical semivariogram using these residuals. How would you interpret this empirical semivariogram of residuals?

From the residual semivariogram estimated in Question 2, fit and plot a theoretical semivariogram model for the residual semivariogram.

**Activity Part II**

What is your interpretation of the semivariograms above?

How would you use the information provided by the variographic analysis above to improve your predictions (spatially interpolated values) of the field?

### References

*Interactive Spatial Data Analysis*. Book. Essex: Addison Wesley Longman.

*Applied Spatial Data Analysis with r*. Book. New York: Springer Science+Business Media.

*An Introduction to r for Spatial Analysis and Mapping*. Book. Sage.

*Applied Geostatistics*. Book. New York: Oxford University Press.

*Geographic Information Analysis*. Book. 2nd. Edition. Hoboken, New Jersey: John Wiley & Sons.