[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
## Basic calculation mistakes (e.g. mean/median)

**From**: |
Andreas Sommer |

**Subject**: |
Basic calculation mistakes (e.g. mean/median) |

**Date**: |
Sat, 03 Oct 2020 11:42:39 -0000 |

**User-agent**: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 |

Hi,
I just started using datamash on a small dataset and noticed its calculations
are off. And indeed it doesn't calculate basics correctly. Or it somehow
depends on the type of display (see below argument combinations):
---
$ seq 1 3 | datamash mean 1 median 1
2 2
$ seq 1 3 | datamash -H mean 1 median 1
mean(1) median(1)
2.5 2.5
$ seq 1 3 | datamash -R 5 -H mean 1 median 1
mean(1) median(1)
2.50000 2.50000
---
$ seq 1 4 | datamash -H -R 2 mean 1 median 1
mean(1) median(1)
3.00 3.00
$ seq 1 4 | datamash -R 2 mean 1 median 1
2.50 2.50
$ seq 1 4 | datamash mean 1 median 1
2.5 2.5
---
Until that gets fixed, it means I can't trust the tool :(
Cheers,
Andreas

**Basic calculation mistakes (e.g. mean/median)**,
*Andreas Sommer* **<=**