X-Received: by 2002:a6b:e413:: with SMTP id u19mr3237813iog.34.1555255180018; Sun, 14 Apr 2019 08:19:40 -0700 (PDT) X-Received: by 2002:a9d:4d0d:: with SMTP id n13mr23036767otf.191.1555255179677; Sun, 14 Apr 2019 08:19:39 -0700 (PDT) Path: csiph.com!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!b2no339905itd.0!news-out.google.com!r82ni443ita.0!nntp.google.com!136no338818itk.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.graphics.apps.gnuplot Date: Sun, 14 Apr 2019 08:19:39 -0700 (PDT) Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a02:a03f:54b2:9e00:d4e7:2fe2:cf88:e350; posting-account=6f4zEAoAAABcPGvJdTxtF_Mhoal-gK1d NNTP-Posting-Host: 2a02:a03f:54b2:9e00:d4e7:2fe2:cf88:e350 User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <09207591-2b4d-4b5a-8460-cec754f3496d@googlegroups.com> Subject: strange discrepancy between stats command result and fitting result From: "hugocoolens@gmail.com" Injection-Date: Sun, 14 Apr 2019 15:19:40 +0000 Content-Type: text/plain; charset="UTF-8" Lines: 39 Xref: csiph.com comp.graphics.apps.gnuplot:4180 I am puzzled by the following discrepancy between a stats command result and the result which I have from normal Gnuplot fitting: This is my Gnuplot batch-file datafile='scallogmet.dat' f(x)=a*log10(x)+b a=-1.06 b=-4.78 fit [3e-3:1] f(x) datafile using ($1):($2) via a,b stats [3e-3:1] datafile using (log10($1)):($2) This is the content of scallogmet.dat: 0.001 -0.4421 0.002 -1.4743 0.003 -1.7844 0.004 -1.9640 0.005 -2.102 0.01 -2.483 0.02 -2.837 0.03 -3.034 0.04 -3.173 0.05 -3.28 0.1 -3.614 0.2 -3.96 0.3 -4.143 0.5 -4.408 1 -4.8 2 -5.294 3 -5.655 4 -5.96 5 -6.244 6 -6.509 7 -6.755 8 -7 9 -7.232 10 -7.46 The Gnuplot fitting gives me y=ax+b, with the correct a=-1.16816 and b=-4.78604 But the stats-command gives: y = -3.104 x - 4.194 Why do U get the wrong result with stats? thanks in advance