[R] Use of geometric mean for geochemical concentrations

Leo Mada |eo@m@d@ @end|ng |rom @yon|c@eu
Tue Jan 30 14:49:06 CET 2024


Dear Rich,

It depends how the data is generated.

Although I am not an expert in ecology, I can explain it based on a biomedical example.

Certain variables are generated geometrically (exponentially), e.g. MIC or Titer.

MIC = Minimum Inhibitory Concentration for bacterial resistance
Titer = dilution which still has an effect, e.g. serially diluting blood samples;

Obviously, diluting the samples will generate the following concentrations:
1, 1/2, 1.4, 1/8, 1/16, ...
(or the reciprocal: 1, 2, 4, 8, 16, ...)

It makes no sense to compute the arithmetic mean. Results are usually reported as some quantile (median or 90%); alternatively, one computes the geometric mean.

### Ecology /Environmental Chemistry
I suppose that certain chemicals may be generated/released in the environment through a non-linear process. The LLOD may also play a role, but may NOT be the main reason. If the generating process is exponential, then the arithmetic mean would strongly skew the results (also inconsistently based on season, particular year, etc - the generating processes may differ).

### Harmonic Mean
Did not encounter it often: maybe because of the problematic handling of 0.

I do have in the meantime a nice workaround for 0 (which also works with the geometric mean), see also (unfortunately not well documented):
https://github.com/discoleo/R/blob/master/Stat/Moments.Stat.R
v0 = 1; # some initial "skew"
1 /(xharm + v0) = sum( 1 / (x + v0) ) / length(x)
xgeom = prod(x + v0)^(1/length(x)) - v0;

I apologize for the late reply; I did not have much time to read messages during the past weeks.

Sincerely,

Leonard


	[[alternative HTML version deleted]]



More information about the R-help mailing list