Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #746

Re: Wrong mean (stats) and wrong column number

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!z1g2000vbx.googlegroups.com!not-for-mail
From Péter Juhász <peter.juhasz83@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Wrong mean (stats) and wrong column number
Date Tue, 13 Dec 2011 02:53:53 -0800 (PST)
Organization http://groups.google.com
Lines 51
Message-ID <8316e08c-3cd5-418a-ada6-3ebea582bd5a@z1g2000vbx.googlegroups.com> (permalink)
References <b226cee0-9900-4b2c-8d50-ea19c83272b8@w3g2000vbw.googlegroups.com>
NNTP-Posting-Host 193.225.144.95
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
X-Trace posting.google.com 1323775216 466 127.0.0.1 (13 Dec 2011 11:20:16 GMT)
X-Complaints-To groups-abuse@google.com
NNTP-Posting-Date Tue, 13 Dec 2011 11:20:16 +0000 (UTC)
Complaints-To groups-abuse@google.com
Injection-Info z1g2000vbx.googlegroups.com; posting-host=193.225.144.95; posting-account=zDLjuQoAAAC_blU_eX_4MHabi0k_sknv
User-Agent G2/1.0
X-Google-Web-Client true
X-Google-Header-Order HUALESNKRC
X-HTTP-UserAgent Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.24) Gecko/20111107 Ubuntu/10.04 (lucid) Firefox/3.6.24,gzip(gfe)
Xref x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:746

Show key headers only | View raw


On Dec 13, 11:37 am, Andreas Heindl <andreas.hei...@gmail.com> wrote:
> Hi!
>
> Today I encountered a strange problem with gnuplot 4.5 patchlevel 0. I
> have a file containing three colums (seperated by tabs)
>
> Column 1: n=15
> Column 2: n=15
> Column 3: n=30
>
> I calculated the mean and stdev via OpenOffice Calc for each of the
> columns as well as via
>
> stats 'MyInputFile.txt' using 1 name "A"      #1
> #do some plotting
> stats 'MyInputFile.txt' using 2 name "A"      #2
> #do some plotting
> stats 'MyInputFile.txt' using 3 name "A"      #3
>
> First I noticed that column 1 (statement #1) has 30 records which is
> strange because it only contains 15 elements.
>
> FILE:
>   Records:      30
>   Out of range:  0
>   Invalid:       0
>   Blank:         0
>   Data Blocks:   1
>
> Second I'm puzzled, assuming the numbering starts from the back, why
> mean and stdev are completely different from those computed by
> OpenOffice. The only mean / stdev value that is correct is the one
> from statement #2.
>
> Any hints? I'm stuck currently ...
> Thanks,
> Andreas

Did you set the column separator correctly?

By default gnuplot splits lines on whitespace - any amount of
whitespace.
This means that the two tab characters intended to mean two empty
values after the 15th line will be ignored and the single meaningful
value found in the lines will be read as in they were in the first
column.

Try saving the file as a comma (or semicolon) separated file, then in
gnuplot issue 'set datafile separator ";"' before plotting.

Péter Juhász

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Find similar


Thread

Wrong mean (stats) and wrong column number Andreas Heindl <andreas.heindl@gmail.com> - 2011-12-13 02:37 -0800
  Re: Wrong mean (stats) and wrong column number Péter Juhász <peter.juhasz83@gmail.com> - 2011-12-13 02:53 -0800

csiph-web