You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/wilcoxon/README.md
+14-37Lines changed: 14 additions & 37 deletions
Original file line number
Diff line number
Diff line change
@@ -186,7 +186,7 @@ table = out.print();
186
186
*/
187
187
```
188
188
189
-
By default, all zero-differences are discarded before calculating the ranks. Set `zeroMethod` to `pratt` when you wish differences of zero to be used in the rank calculation but then drop them or to `zsplit` when differences of zero are shall be used in the ranking procedure and the ranks then split between positive and negative ones.
189
+
By default, all zero-differences are discarded before calculating the ranks. Set `zeroMethod` to `pratt` when you wish differences of zero to be used in the rank calculation but then drop them or to `zsplit` when differences of zero are shall be used in the ranking procedure and the ranks then split between positive and negative ones.
190
190
191
191
```javascript
192
192
var arr = [ 0, 2, 3, -1, -4, 0, 0, 8, 9 ];
@@ -220,21 +220,14 @@ out = wilcoxon( arr, {
220
220
By default, the test uses the exact distribution of the rank statistic to calculate the critical values for the test in case of no ties and no zero-differences. Since it is more computationally efficient, starting with fifty observations a normal approximation is employed. If you would like the test to use the correct distribution even for larger samples, set the `exact` option to `true`.
221
221
222
222
```javascript
223
-
var normal =require( '@stdlib/random/base/normal' ).factory;
224
-
var rnorm;
225
-
var arr;
226
-
var out;
227
-
var i;
223
+
var normal =require( '@stdlib/random/array/normal' );
228
224
229
-
rnorm =normal( 0.0, 4.0, {
225
+
varrnorm =normal.factory( 0.0, 4.0, {
230
226
'seed':100
231
227
});
232
-
arr =newArray( 100 );
233
-
for ( i =0; i <arr.length; i++ ) {
234
-
arr[ i ] =rnorm();
235
-
}
228
+
var arr =rnorm( 100 );
236
229
237
-
out =wilcoxon( arr, {
230
+
varout =wilcoxon( arr, {
238
231
'exact':false
239
232
});
240
233
/* e.g., returns
@@ -264,21 +257,14 @@ out = wilcoxon( arr, {
264
257
By default, when using the normal approximation, the test uses a continuity correction, which adjusts the Wilcoxon rank statistic by `0.5` towards the mean. To disable this correction, set `correction` to `false`.
265
258
266
259
```javascript
267
-
var normal =require( '@stdlib/random/base/normal' ).factory;
268
-
var rnorm;
269
-
var arr;
270
-
var out;
271
-
var i;
260
+
var normal =require( '@stdlib/random/array/normal' );
272
261
273
-
rnorm =normal( 0.0, 4.0, {
262
+
varrnorm =normal.factory( 0.0, 4.0, {
274
263
'seed':100
275
264
});
276
-
arr =newArray( 100 );
277
-
for ( i =0; i <arr.length; i++ ) {
278
-
arr[ i ] =rnorm();
279
-
}
265
+
var arr =rnorm( 100 );
280
266
281
-
out =wilcoxon( arr, {
267
+
varout =wilcoxon( arr, {
282
268
'correction':false
283
269
});
284
270
/* e.g., returns
@@ -316,26 +302,17 @@ out = wilcoxon( arr, {
316
302
<!-- eslint no-undef: "error" -->
317
303
318
304
```javascript
319
-
var uniform =require( '@stdlib/random/base/discrete-uniform' ).factory;
305
+
var uniform =require( '@stdlib/random/array/discrete-uniform' );
320
306
var wilcoxon =require( '@stdlib/stats/wilcoxon' );
321
307
322
-
var table;
323
-
var runif;
324
-
var arr;
325
-
var out;
326
-
var i;
327
-
328
-
runif =uniform( -50.0, 50.0, {
308
+
var runif =uniform.factory( -50.0, 50.0, {
329
309
'seed':37827
330
310
});
331
-
arr =newArray( 100 );
332
-
for ( i =0; i <arr.length; i++ ) {
333
-
arr[ i ] =runif();
334
-
}
311
+
var arr =runif( 100 );
335
312
336
313
// Test whether distribution is symmetric around zero:
0 commit comments