From 625fa139a919a52e4ad3fc61d5aa625bef37e2f2 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Tue, 19 Jan 2021 19:26:47 +0100 Subject: Corret the t-value von a C.I. of 95% It's 1.960, not 2 Suggested-by: Willem Ferguson Signed-off-by: Robert C. Helling --- stats/statsview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stats') 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)); -- cgit v1.2.3-70-g09d2