File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/stats Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ var pow = require( '@stdlib/math/base/special/pow' );
3737* @example
3838* var u = 5;
3939* var out = quartic(u);
40- * // returns 0
40+ * // returns 0.0
4141*/
4242function quartic ( u ) {
4343 if ( isnan ( u ) ) {
Original file line number Diff line number Diff line change @@ -36,7 +36,8 @@ var pow = require( '@stdlib/math/base/special/pow' );
3636*
3737* @example
3838* var u = 5;
39- * out = triweight(u); // returns 0
39+ * out = triweight(u);
40+ * // returns 0.0
4041*/
4142function triweight ( u ) {
4243 var absU ;
Original file line number Diff line number Diff line change @@ -71,16 +71,16 @@ function print( opts ) { // eslint-disable-line stdlib/no-redeclare
7171 str += '\n\n' ;
7272 str += 'Null hypothesis: the CDF of `x` is ' ;
7373 switch ( this . alternative ) {
74- case 'two-sided' :
75- default :
76- str += 'equal to ' ;
77- break ;
7874 case 'less' :
7975 str += 'greater than or equal to ' ;
8076 break ;
8177 case 'greater' :
8278 str += 'less than or equal to ' ;
8379 break ;
80+ case 'two-sided' :
81+ default :
82+ str += 'equal to ' ;
83+ break ;
8484 }
8585 str += 'the reference CDF' ;
8686 str += '\n\n' ;
Original file line number Diff line number Diff line change @@ -121,10 +121,6 @@ function ranks( x, options ) {
121121 ( xnew [ ordered [ i ] ] !== xnew [ ordered [ iPlusOne ] ] )
122122 ) {
123123 switch ( method ) {
124- case 'average' :
125- default :
126- tieRank = iPlusOne - ( 0.5 * noDuplicates ) ;
127- break ;
128124 case 'min' :
129125 tieRank = iPlusOne - noDuplicates ;
130126 break ;
@@ -135,6 +131,10 @@ function ranks( x, options ) {
135131 tieRank = iPlusOne - noDuplicates - totalNoTies ;
136132 totalNoTies += noDuplicates ;
137133 break ;
134+ case 'average' :
135+ default :
136+ tieRank = iPlusOne - ( 0.5 * noDuplicates ) ;
137+ break ;
138138 }
139139 for ( j = i - noDuplicates ; j < iPlusOne ; j ++ ) {
140140 ranks [ ordered [ j ] ] = tieRank ;
Original file line number Diff line number Diff line change @@ -72,16 +72,16 @@ function print( opts ) { // eslint-disable-line stdlib/no-redeclare
7272 str += 'Alternative hypothesis: ' ;
7373 str += 'True difference in means is ' ;
7474 switch ( this . alternative ) {
75- case 'two-sided' :
76- default :
77- str += 'not equal to ' ;
78- break ;
7975 case 'less' :
8076 str += 'less than ' ;
8177 break ;
8278 case 'greater' :
8379 str += 'greater than ' ;
8480 break ;
81+ case 'two-sided' :
82+ default :
83+ str += 'not equal to ' ;
84+ break ;
8585 }
8686 str += this . nullValue ;
8787 str += '\n\n' ;
Original file line number Diff line number Diff line change @@ -75,16 +75,16 @@ function print( opts ) { // eslint-disable-line stdlib/no-redeclare
7575 str += 'Median of `x` is ' ;
7676 }
7777 switch ( this . alternative ) {
78- case 'two-sided' :
79- default :
80- str += 'not equal to ' ;
81- break ;
8278 case 'less' :
8379 str += 'less than ' ;
8480 break ;
8581 case 'greater' :
8682 str += 'greater than ' ;
8783 break ;
84+ case 'two-sided' :
85+ default :
86+ str += 'not equal to ' ;
87+ break ;
8888 }
8989 str += this . nullValue ;
9090 str += '\n\n' ;
You can’t perform that action at this time.
0 commit comments