@@ -278,7 +278,7 @@ function stats.winsorMean(data, alpha)
278278 if math.abs (alpha ) ~= alpha then
279279 expect (2 , alpha , " non-negative number" )
280280 end
281- if alpha > 0.5 then execpt (2 , alpha , " number less than or equal to 0.5" )
281+ if alpha > 0.5 then execpt (2 , alpha , " number less than or equal to 0.5" ) end
282282 end
283283 alpha = alpha or 0.05
284284 local t = { table.unpack (data ) }
@@ -519,7 +519,7 @@ function stats.testdata(n, a, b)
519519 expect (1 , n , " number" )
520520 expect (2 , a , " number" )
521521 expect (3 , b , " number" )
522- if n < 1 then expect (1 , n , " number greater than or equal to one" )
522+ if n < 1 then expect (1 , n , " number greater than or equal to one" ) end
523523 local result = {}
524524 a = a or 0
525525 b = b or 1
569569function stats .linRegPred (model , xval )
570570 expect (1 , model , " table" )
571571 expect (2 , xval , " number" )
572- expect (1 , model .slope , " linear regression model " )
573- expect (1 , model .intercept , " linear regression model " )
572+ expect (1 , model .slope , " number " )
573+ expect (1 , model .intercept , " number " )
574574 if not model then return nil end
575575 return model .slope * xval + model .intercept
576576end
@@ -586,8 +586,8 @@ function stats.r2(x, y, model)
586586 expect (1 , x , " table" )
587587 expect (2 , y , " table" )
588588 expect (3 , model , " table" )
589- expect (3 , model .slope , " linear regression model " )
590- expect (3 , model .intercept , " linear regression model " )
589+ expect (3 , model .slope , " number " )
590+ expect (3 , model .intercept , " number " )
591591 local n = # y
592592 if n == 0 or not model then return nil end
593593
0 commit comments