# Multi-variate data

Multi-variate data has one or more independent variables and more than one dependent ones. Think, for instance, of weight-at-time for females and males. The concept that predictions for the various data are coupled by sharing parameters is key to DEB theory as well as to multi-variate data.
Uni-, bi- and tri-variate
variables have one, two or three **independent** variables.
More independent variables can be included via auxiliary data.

Since AmP deals with an arbitrary number of data sets, and a collection of uni-variate data sets can have the same independent variable
and presented in a grouped plot, there is no need, other than convenience, to deal with multi-variate data with several **dependent** variables explicitly.
To present a set of uni-variate data in a grouped plot, they all must have the same units and labels.
To produce a grouped plot, the metaData as defined in a mydata-file needs to have field `metaData.grp.sets`

and, optionally,
fields `metaData.grp.title`

and `metaData.grp.subtitle`

.
A title becomes part of the produced png-file, a subtitle not and is only shown in the modal-presentation of the plot (i.e. after clicking on it).
An example of a grouped plot is given in the dog-entry.
Bi- and tri-variate data sets do not need a grouped-plot definition;
it is not possible to combine such data sets with other data sets in a grouped plot.

An example of multi-variate can be found with the Doliolid: Dolioletta gegenbauri. The excerpt of the code below show how the multi-variate is set within the mydata file:

```
% food density - ingestion rate
data.XJX = [ ... % phytoplankton conc. (mug C/l), ingestion rate (mug C/d)
20 3.059 7.620 10.471
60 6.328 15.259 30.081
160 7.753 25.995 69.321
390 4.171 12.533 38.757];
units.XJX = {'mug C/l', 'mug C/d'}; label.XJX = {'phytoplankton conc.', 'ingestion rate'};
treat.XJX = {2, [5; 15; 35]}; units.treat.XJX = 'mug C'; label.treat.XJX = 'zooid C weight';
temp.XJX = C2K(20); units.temp.XJX = 'K'; label.temp.XJX = 'temperature';
bibkey.XJX = 'GibsPaff2000';
subtitle.XJX = 'ingestion rate';
comment.XJX = 'Data for gonozooid';
```

If a data-matrix has 3 columns, i.e. 1 independent variable and 2 dependent ones, and if the units as well as the label for that data set is a cell-string of length 3, a plot is created with 2 different y-axes. The first element of treat must then be 0 or 1, not 2, and no legend is produced. All that relates to the left yaxis is plotted in red, to the right in blue. An example of a plot with two different y-axes is given in the entries Vipera_aspis and, Sialia_mexicana (first element of treat is 1).

Yet it can be handy to specify a multi-variate data set as a matrix where the first column is treated as the independent variable and the others are dependent ones.
The specification in AmP follows the rules of those for bi-variate data, where the first element of `auxData.treat`

is 0 or 1.
See further under bi-variate data.