The **challenge of dealing with zero or missing values** are often underestimated, ignored or used as excuse to pass on necessary transformation for constrained data.

One of the most heard excuse for avoiding the need of transformations for compositional or constraint data analyses is **"I cannot apply the logarithm out on zeros, but my data contains a lot of zeros!"**
This sentence is apparently completely true, but remains an excuse:

**Plausibility of zeros as reported values for positive reel variables**

Let us imagine a data set of daily reported precipitation. For a certain day, zero [mm] precipitation has been reported.

How can we interpret this non-existing (amount of) precipitation:

- Only very few precipitation occurred over a very short time and our rain gauge did not caught any raindrops or snow flakes by random but the immediate surrounding. Here, we cannot assume that there was no precipitation but did not observed by random. Thus, we have to interpret the zero value as code for
**missing**value**by random (MAR)**. - Imagine, on this particular day only very small sized drizzles occurred in the morning, have been caught in the rain gauge (e.g. a graduated cylinder) and evaporated very shortly afterward by changes in temperature, pressure or relative humidity. In this case we have to assume a
**missing**value**not at random (MNAR)**, because there is a certain reason for the missing value. - Every methods has its own accuracy. Thus, approaching zero we will certainly reach a detection limit. Passing this specific limit, a zero value has to be interpreted as a (an erroneous) coding for
**below detection limit (BDL)**. - Let's assume we have a rain gauge which is not able to sample snow precipitation. In this case we are getting the information of no precipitation. Consequently, we consider this event as
**essential or structural zero (SZ)**cf. e.g.Lubbe et al., 2021. - If we have to assume
**true zeros**, meaning*absolutely no precipitation*in our case, we cannot state*0 mm or 0 $l/m^2$ precipitation*, because of having no event, no measure can be applied! Only in small samples of count compositions zero counts may occur (cf. v.d. Boogaart & Tolosana-Delgado,2013: chapter 7).

Dealing with zeros in positive data depends on the context and purpose of your analysis.
Here are some **possible approaches**:

**Ignore the zeros**: This is definitely a really bad choice, because it may result in a loss of information or bias in your results.**Use zeros as usual measurements**: Hereby, you will get an arbitrary distribution, because the non- or non-measured values are part of the frequency distribution of measured values. Already in estimation of central tendency serious trouble will come up: median and arithmetic mean will shift to the left and in the likely case $x\in\mathbb R_+$ you will get a geometric mean of $\bar x_{geo}=0$. All further analyses wil become nonsense.**Analyze separately**: If the zeros represent a distinct category or subgroup of the data, you can analyze them separately from the positive values. For example, if the data represent precipitation registered at a rain gauge, any non-zero number represents a time interval of registered precipitation, whereas zero values means no-precipitation. You may analyses your data using binary approaches for estimation of occurrence frequency/pattern/probability. The amount of precipitation can be analysed in a meaningful way using only the non-zero values.**Replace the zeros**: If the zeros represent values that are expected to be positive but are missing or incomplete , you can replace them with an imputed value. Pan & Chen, 2023 empirically evaluated zero-imputation approaches for multivariate missing data (MCAR, MAR, MNAR) in public health.

Azur et al., 2011 present a brief explanation and intro into Multiple Imputation by Chain Equations (MICE), Lubbe et al., 2021 focussed on several imputation methods for compositional data. A comprehensive and useful presentation for all above mentioned types of zeros/missings can be found in v.d. Boogaart & Tolosana-Delgado,2013: chapter 7). Palarea-Albaladejo and Martin-Fernández, 2011 focused on handling of values below detection limts (BDL) in compositional data with code example for Matlab and R.

**Citation**

The E-Learning project SOGA-Py was developed at the Department of Earth Sciences by Annette Rudolph, Joachim Krois and Kai Hartmann. You can reach us via mail by soga[at]zedat.fu-berlin.de.

You may use this project freely under the Creative Commons Attribution-ShareAlike 4.0 International License.

Please cite as follow: *Rudolph, A., Krois, J., Hartmann, K. (2023): Statistics and Geodata Analysis
using Python (SOGA-Py). Department of Earth Sciences, Freie Universitaet Berlin.*