summaryrefslogtreecommitdiffstats
path: root/stats
diff options
context:
space:
mode:
authorGravatar Robert C. Helling <helling@atdotde.de>2021-01-19 19:26:47 +0100
committerGravatar Robert C. Helling <helling@atdotde.de>2021-01-19 20:54:19 +0100
commit625fa139a919a52e4ad3fc61d5aa625bef37e2f2 (patch)
treefa46da73dca690f71ebbf81b018e62761359be90 /stats
parent25cfd852b910c7bbd53f0a1a5244c659761c2cc5 (diff)
downloadsubsurface-625fa139a919a52e4ad3fc61d5aa625bef37e2f2.tar.gz
Corret the t-value von a C.I. of 95%
It's 1.960, not 2 Suggested-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Robert C. Helling <helling@atdotde.de>
Diffstat (limited to 'stats')
-rw-r--r--stats/statsview.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/stats/statsview.cpp b/stats/statsview.cpp
index e5e6b0b0d..be296cf44 100644
--- a/stats/statsview.cpp
+++ b/stats/statsview.cpp
@@ -752,10 +752,10 @@ void StatsView::RegressionLine::updatePosition()
QPolygonF poly;
for (double x = minX; x <= maxX + 1; x += (maxX - minX) / 100)
poly << QPointF(xAxis->toScreen(x),
- yAxis->toScreen(reg.a * x + reg.b + 2.0 * sqrt(reg.res2 / (reg.n - 2) * (1.0 / reg.n + (x - reg.xavg) * (x - reg.xavg) / (reg.n - 1) * (reg.n -2) / reg.sx2))));
+ yAxis->toScreen(reg.a * x + reg.b + 1.960 * sqrt(reg.res2 / (reg.n - 2) * (1.0 / reg.n + (x - reg.xavg) * (x - reg.xavg) / (reg.n - 1) * (reg.n -2) / reg.sx2))));
for (double x = maxX; x >= minX - 1; x -= (maxX - minX) / 100)
poly << QPointF(xAxis->toScreen(x),
- yAxis->toScreen(reg.a * x + reg.b - 2.0 * sqrt(reg.res2 / (reg.n - 2) * (1.0 / reg.n + (x - reg.xavg) * (x - reg.xavg) / (reg.n - 1) * (reg.n -2) / reg.sx2))));
+ yAxis->toScreen(reg.a * x + reg.b - 1.960 * sqrt(reg.res2 / (reg.n - 2) * (1.0 / reg.n + (x - reg.xavg) * (x - reg.xavg) / (reg.n - 1) * (reg.n -2) / reg.sx2))));
QRectF box(QPoint(xAxis->toScreen(minX), yAxis->toScreen(minY)), QPoint(xAxis->toScreen(maxX), yAxis->toScreen(maxY)));
item->setPolygon(poly.intersected(box));