# 12.1 Overview - Control charts

#### Rationale
Suppose you have multivariate data (e.g., abundances of multiple species) sampled repeatedly through time. For example, annual surveys at a site would yield multiple time-points: year 1, year 2, year 3, ..., year $t$, and so on. With each new time point, one might ask - is the community (multivariate observation) at time $t$ ***unusual*** (significantly different) from what has been observed prior to that time? By using the **Control chart** routine in PRIMER 8, we are able to discern if a new sample point is 'in-control' or 'out-of-control', by comparison with a reference set of previous ('in-control') observations.

This is clearly a very useful tool in an environmental monitoring context. The control chart tool can also be used in virtually any cases where we want to ***identify outliers*** in multivariate space. We may wish to do this in a Euclidean space, or in the space of some other resemblance measure, such as Bray-Curtis.

This chapter begins with a brief description of a classical univariate control chart, as used historically in statistical process control-type settings ({{@954#bkmrk-shewhart1931}}, {{@954#bkmrk-shewhart1939}}, {{@954#bkmrk-montgomery2020}}). We then move to consider a classical multivariate control chart, which relies on the assumption of multivariate normality for the in-control set of samples (the 'reference' set). Building on this, we outline a ***dissimilarity-based multivariate control chart method***, described in {{@954#bkmrk-adegoke2019}}, which is further generalised and extended *via* its implementation in PRIMER 8. This approach improves on the earlier work of {{@954#bkmrk-andersonthompson2004}}, because it accommodates anisotropy (non-spherical shapes / correlation structure) in the reference (in-control) set of multivariate samples. We provide details of how to set control-chart limits using either a parametric or a non-parametric criterion.

Finally, we demonstrate the use of the control-chart tool in PRIMER 8 by way of an example, analysing $N$ = 38 years of data on the abundances of $p$ = 156 species of birds observed at Grand Forks, British Columbia, Canada, from the North American Breeding Bird Survey ([BBS](https://www.pwrc.usgs.gov/bbs/)).

#### 'Flavours' of control chart
The **Control chart** routine in PRIMER 8 offers three different types (or 'flavours') of control chart that can be built for a given dataset. These types depend on the scale and size of the reference set of 'in-control' samples that is desired by the end-user. More specifically, the reference set can be comprised of:
- all samples taken prior to the test sample ('**progressive**' control chart);
- a specified number of initial samples ('**baseline**' control chart); or
- a specified number of samples taken immediately prior to the test sample ('**moving window**' control chart).

Essentially, a ***progressive*** control-chart will be good at highlighting when there is a sudden change (a 'jump') in the multivariate time series. However, one should beware of interpreting results in the time series (e.g., at times $(t+1)$, $(t+2)$, ...) once an 'out-of-control' point has been identified at time $t$.

A ***baseline*** control chart will be good at tracking variation through time away from an original set of (reference) samples, and can detect either a sudden jump, or (eventually) a more gradual change, e.g., if samples drift over time and move away from the original (reference) set. 

In contrast, the ***moving window*** option is designed to accommodate a certain amount of 'drift', under the rationale that we may expect a certain amount of natural change over time. A new sample point is only compared to a subset of recent samples (inside a chosen time-frame/window), so the moving-window control chart will be sensitive to sudden changes, but overall random drift at a broad scale will not necessarily be detected as significant.