@stdlib/stats-wilcoxon 0.1.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +6 -3
- package/SECURITY.md +5 -0
- package/dist/index.js +1 -1
- package/docs/types/index.d.ts +2 -2
- package/package.json +25 -43
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -432,7 +432,7 @@ See [LICENSE][stdlib-license].
|
|
|
432
432
|
|
|
433
433
|
## Copyright
|
|
434
434
|
|
|
435
|
-
Copyright © 2016-
|
|
435
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
436
436
|
|
|
437
437
|
</section>
|
|
438
438
|
|
|
@@ -445,8 +445,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
445
445
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/stats-wilcoxon.svg
|
|
446
446
|
[npm-url]: https://npmjs.org/package/@stdlib/stats-wilcoxon
|
|
447
447
|
|
|
448
|
-
[test-image]: https://github.com/stdlib-js/stats-wilcoxon/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
449
|
-
[test-url]: https://github.com/stdlib-js/stats-wilcoxon/actions/workflows/test.yml?query=branch:v0.1
|
|
448
|
+
[test-image]: https://github.com/stdlib-js/stats-wilcoxon/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
449
|
+
[test-url]: https://github.com/stdlib-js/stats-wilcoxon/actions/workflows/test.yml?query=branch:v0.2.1
|
|
450
450
|
|
|
451
451
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-wilcoxon/main.svg
|
|
452
452
|
[coverage-url]: https://codecov.io/github/stdlib-js/stats-wilcoxon?branch=main
|
|
@@ -469,8 +469,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
469
469
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
470
470
|
|
|
471
471
|
[deno-url]: https://github.com/stdlib-js/stats-wilcoxon/tree/deno
|
|
472
|
+
[deno-readme]: https://github.com/stdlib-js/stats-wilcoxon/blob/deno/README.md
|
|
472
473
|
[umd-url]: https://github.com/stdlib-js/stats-wilcoxon/tree/umd
|
|
474
|
+
[umd-readme]: https://github.com/stdlib-js/stats-wilcoxon/blob/umd/README.md
|
|
473
475
|
[esm-url]: https://github.com/stdlib-js/stats-wilcoxon/tree/esm
|
|
476
|
+
[esm-readme]: https://github.com/stdlib-js/stats-wilcoxon/blob/esm/README.md
|
|
474
477
|
[branches-url]: https://github.com/stdlib-js/stats-wilcoxon/blob/main/branches.md
|
|
475
478
|
|
|
476
479
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/stats-wilcoxon/main/LICENSE
|
package/SECURITY.md
ADDED
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ function oe(e,i){return e-i}function se(e){var i,o,a,u;for(e=e.slice(),e.sort(oe
|
|
|
5
5
|
});var X=V(function(ze,Q){
|
|
6
6
|
var le=require('@stdlib/assert-is-positive-integer/dist'),ue=require('@stdlib/assert-is-plain-object/dist'),ve=require('@stdlib/assert-is-boolean/dist').isPrimitive,J=require('@stdlib/assert-has-own-property/dist'),K=require('@stdlib/math-base-special-roundn/dist'),D=require('@stdlib/error-tools-fmtprodmsg/dist');function fe(e){var i,o,a;if(o=4,i=!0,arguments.length>0){if(!ue(e))throw new TypeError(D('1Lx3L',e));if(J(e,"digits")){if(!le(e.digits))throw new TypeError(D('1Lx3P',"digits",e.digits));o=e.digits}if(J(e,"decision")){if(!ve(e.decision))throw new TypeError(D('1Lx2o',"decision",e.decision));i=e.decision}}switch(a="",a+=this.method,a+="\n\n",a+="Alternative hypothesis: ",this.method==="Paired Wilcoxon signed rank test"?a+="Median of the difference `x - y` is ":a+="Median of `x` is ",this.alternative){case"less":a+="less than ";break;case"greater":a+="greater than ";break;case"two-sided":default:a+="not equal to ";break}return a+=this.nullValue,a+="\n\n",a+=" pValue: "+K(this.pValue,-o)+"\n",a+=" statistic: "+K(this.statistic,-o)+"\n",a+="\n",i&&(a+="Test Decision: ",this.rejected?a+="Reject null in favor of alternative at "+this.alpha*100+"% significance level":a+="Fail to reject null in favor of alternative at "+this.alpha*100+"% significance level",a+="\n"),a}Q.exports=fe
|
|
7
7
|
});var ae=V(function(Me,ie){
|
|
8
|
-
var Y=require('@stdlib/assert-is-number-array/dist').primitives,$=require('@stdlib/assert-is-typed-array-like/dist'),p=require('@stdlib/utils-define-read-only-property/dist'),ce=require('@stdlib/assert-is-plain-object/dist'),he=require('@stdlib/stats-ranks/dist'),de=require('@stdlib/stats-base-dists-normal-cdf/dist').factory,k=require('@stdlib/stats-base-dists-signrank-cdf/dist'),me=require('@stdlib/utils-tabulate/dist'),ge=require('@stdlib/math-base-special-signum/dist'),pe=require('@stdlib/math-base-special-sqrt/dist'),ee=require('@stdlib/math-base-special-abs/dist'),re=require('@stdlib/array-float64/dist'),L=require('@stdlib/error-tools-fmtprodmsg/dist'),we=H(),be=G(),qe=X(),S=de(0,1);function ye(){var e,i,o,a,u,O,T,l,P,z,m,v,f,w,A,t,F,c,R,q,M,y,n,r,g,x,b,s,h;if(s=arguments[0],!$(s)&&!Y(s))throw new TypeError(L('1Lx8R',s));if(t=s.length,arguments.length>1)if(ce(arguments[1]))o=arguments[1];else{if(h=arguments[1],!$(h)&&!Y(h))throw new TypeError(L('1LxA5',"y",h));if(t!==h.length)throw new Error(
|
|
8
|
+
var Y=require('@stdlib/assert-is-number-array/dist').primitives,$=require('@stdlib/assert-is-typed-array-like/dist'),p=require('@stdlib/utils-define-read-only-property/dist'),ce=require('@stdlib/assert-is-plain-object/dist'),he=require('@stdlib/stats-ranks/dist'),de=require('@stdlib/stats-base-dists-normal-cdf/dist').factory,k=require('@stdlib/stats-base-dists-signrank-cdf/dist'),me=require('@stdlib/utils-tabulate/dist'),ge=require('@stdlib/math-base-special-signum/dist'),pe=require('@stdlib/math-base-special-sqrt/dist'),ee=require('@stdlib/math-base-special-abs/dist'),re=require('@stdlib/array-float64/dist'),L=require('@stdlib/error-tools-fmtprodmsg/dist'),we=H(),be=G(),qe=X(),S=de(0,1);function ye(){var e,i,o,a,u,O,T,l,P,z,m,v,f,w,A,t,F,c,R,q,M,y,n,r,g,x,b,s,h;if(s=arguments[0],!$(s)&&!Y(s))throw new TypeError(L('1Lx8R',s));if(t=s.length,arguments.length>1)if(ce(arguments[1]))o=arguments[1];else{if(h=arguments[1],!$(h)&&!Y(h))throw new TypeError(L('1LxA5',"y",h));if(t!==h.length)throw new Error(L('1Lx1E'));arguments.length>2&&(o=arguments[2])}if(v={},o&&(A=we(v,o),A))throw A;if(q=v.mu||0,v.correction===void 0?e=!0:e=v.correction,v.alpha===void 0?z=.05:z=v.alpha,t<2)throw new Error(L('1LxA2',s));if(w=v.alternative||"two-sided",i=v.zeroMethod||"wilcox",i==="wilcox"){if(n=[],h)for(r=0;r<t;r++)b=s[r]-h[r]-q,b!==0&&n.push(b);else for(r=0;r<t;r++)s[r]!==0&&n.push(s[r]-q);l=s.length-n.length}else if(n=new re(t),l=0,h)for(r=0;r<t;r++)n[r]=s[r]-h[r]-q,n[r]===0&&(l+=1);else for(r=0;r<t;r++)n[r]=s[r]-q,n[r]===0&&(l+=1);if(l===t)throw new Error(L('1Lx1J'));for(t=n.length,R=new re(t),r=0;r<t;r++)R[r]=ee(n[r]);for(g=he(R),T=0,P=0,r=0;r<t;r++)n[r]>0?T+=g[r]:n[r]===0&&(P+=g[r]);if(a=be(g).length!==g.length,i==="zsplit"&&(T+=P/2),x=T,M=t*(t+1)*.25,y=t*(t+1)*(2*t+1),i==="pratt"){for(F=[],r=0;r<t;r++)n[r]!==0&&F.push(g[r]);g=F,M-=l*(l+1)*.25,y-=l*(l+1)*(2*l+1)}for(u=me(g),O=0,r=0;r<u.length;r++)u[r][1]>1&&(b=u[r][1],O+=b*(b*b-1));if(O>0&&(y-=.5*O),y=pe(y/24),t>50&&!v.exact||l>0||a){if(n=0,e)switch(w){case"two-sided":n=.5*ge(x-M);break;case"less":n=-.5;break;default:n=.5;break}f=(x-M-n)/y,w==="two-sided"?m=2*(1-S(ee(f))):w==="greater"?m=1-S(f):m=S(f)}else f=x,w==="two-sided"?f>t*(t+1)/4?m=2*(1-k(f-1,t)):m=2*k(f,t):w==="greater"?m=1-k(f-1,t):m=k(f,t);return c={},p(c,"rejected",m<=z),p(c,"alpha",z),p(c,"pValue",m),p(c,"statistic",x),p(c,"nullValue",q),p(c,"alternative",w),p(c,"method",(h?"Paired":"One-Sample")+" Wilcoxon signed rank test"),p(c,"print",qe),c}ie.exports=ye
|
|
9
9
|
});var Ee=ae();module.exports=Ee;
|
|
10
10
|
/** @license Apache-2.0 */
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/docs/types/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ interface Results {
|
|
|
128
128
|
* 'alternative': 'greater'
|
|
129
129
|
* });
|
|
130
130
|
*/
|
|
131
|
-
declare function wilcoxon( x: NumericArray, options?: Options ): Results;
|
|
131
|
+
declare function wilcoxon( x: NumericArray, options?: Options ): Results;
|
|
132
132
|
|
|
133
133
|
/**
|
|
134
134
|
* Computes a Wilcoxon signed rank test.
|
|
@@ -150,7 +150,7 @@ declare function wilcoxon( x: NumericArray, options?: Options ): Results; // tsl
|
|
|
150
150
|
* var y = [ 0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29 ];
|
|
151
151
|
* var out = wilcoxon( x, y );
|
|
152
152
|
*/
|
|
153
|
-
declare function wilcoxon( x: NumericArray, y: NumericArray, options?: Options ): Results;
|
|
153
|
+
declare function wilcoxon( x: NumericArray, y: NumericArray, options?: Options ): Results;
|
|
154
154
|
|
|
155
155
|
|
|
156
156
|
// EXPORTS //
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/stats-wilcoxon",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Wilcoxon signed rank test.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -37,40 +30,29 @@
|
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-float64": "^0.1
|
|
41
|
-
"@stdlib/assert-contains": "^0.1
|
|
42
|
-
"@stdlib/assert-has-own-property": "^0.1
|
|
43
|
-
"@stdlib/assert-is-boolean": "^0.1
|
|
44
|
-
"@stdlib/assert-is-nan": "^0.1
|
|
45
|
-
"@stdlib/assert-is-number": "^0.1
|
|
46
|
-
"@stdlib/assert-is-number-array": "^0.1
|
|
47
|
-
"@stdlib/assert-is-plain-object": "^0.1
|
|
48
|
-
"@stdlib/assert-is-positive-integer": "^0.1
|
|
49
|
-
"@stdlib/assert-is-string": "^0.1
|
|
50
|
-
"@stdlib/assert-is-typed-array-like": "^0.1
|
|
51
|
-
"@stdlib/math-base-special-abs": "^0.1
|
|
52
|
-
"@stdlib/math-base-special-roundn": "^0.1
|
|
53
|
-
"@stdlib/math-base-special-signum": "^0.1
|
|
54
|
-
"@stdlib/math-base-special-sqrt": "^0.1
|
|
55
|
-
"@stdlib/stats-base-dists-normal-cdf": "^0.1
|
|
56
|
-
"@stdlib/stats-base-dists-signrank-cdf": "^0.1
|
|
57
|
-
"@stdlib/stats-ranks": "^0.1
|
|
58
|
-
"@stdlib/string-format": "^0.1
|
|
59
|
-
"@stdlib/
|
|
60
|
-
"@stdlib/utils-
|
|
61
|
-
"@stdlib/utils-tabulate": "^0.1.0",
|
|
62
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@stdlib/assert-is-object": "^0.1.0",
|
|
66
|
-
"@stdlib/bench": "^0.1.0",
|
|
67
|
-
"@stdlib/constants-float64-eps": "^0.1.0",
|
|
68
|
-
"@stdlib/random-base-discrete-uniform": "^0.0.6",
|
|
69
|
-
"@stdlib/random-base-randu": "^0.0.8",
|
|
70
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
71
|
-
"istanbul": "^0.4.1",
|
|
72
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
33
|
+
"@stdlib/array-float64": "^0.2.1",
|
|
34
|
+
"@stdlib/assert-contains": "^0.2.1",
|
|
35
|
+
"@stdlib/assert-has-own-property": "^0.2.1",
|
|
36
|
+
"@stdlib/assert-is-boolean": "^0.2.1",
|
|
37
|
+
"@stdlib/assert-is-nan": "^0.2.1",
|
|
38
|
+
"@stdlib/assert-is-number": "^0.2.1",
|
|
39
|
+
"@stdlib/assert-is-number-array": "^0.2.1",
|
|
40
|
+
"@stdlib/assert-is-plain-object": "^0.2.1",
|
|
41
|
+
"@stdlib/assert-is-positive-integer": "^0.2.1",
|
|
42
|
+
"@stdlib/assert-is-string": "^0.2.1",
|
|
43
|
+
"@stdlib/assert-is-typed-array-like": "^0.2.1",
|
|
44
|
+
"@stdlib/math-base-special-abs": "^0.2.1",
|
|
45
|
+
"@stdlib/math-base-special-roundn": "^0.2.1",
|
|
46
|
+
"@stdlib/math-base-special-signum": "^0.2.1",
|
|
47
|
+
"@stdlib/math-base-special-sqrt": "^0.2.1",
|
|
48
|
+
"@stdlib/stats-base-dists-normal-cdf": "^0.2.1",
|
|
49
|
+
"@stdlib/stats-base-dists-signrank-cdf": "^0.2.1",
|
|
50
|
+
"@stdlib/stats-ranks": "^0.2.1",
|
|
51
|
+
"@stdlib/string-format": "^0.2.1",
|
|
52
|
+
"@stdlib/utils-define-read-only-property": "^0.2.1",
|
|
53
|
+
"@stdlib/utils-tabulate": "^0.2.1"
|
|
73
54
|
},
|
|
55
|
+
"devDependencies": {},
|
|
74
56
|
"engines": {
|
|
75
57
|
"node": ">=0.10.0",
|
|
76
58
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|