Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions lib/node_modules/@stdlib/stats/wilcoxon/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ var i;
runif = uniform( -50.0, 50.0, {
'seed': 37827
});
arr = new Array( 100 );
for ( i = 0; i < arr.length; i++ ) {
arr[ i ] = runif();
arr = [];
for ( i = 0; i < 100; i++ ) {
arr.push( runif() );
}

// Test whether distribution is symmetric around zero:
out = wilcoxon( arr );
console.log( out.print() );
/* e.g., =>
One-Sample Wilcoxon signed rank test
One-Sample Wilcoxon signed rank test

Alternative hypothesis: Median of `x` is not equal to 0
Alternative hypothesis: Median of `x` is not equal to 0

pValue: 0.7714
statistic: 2438.5
pValue: 0.7714
statistic: 2438.5

Test Decision: Fail to reject null in favor of alternative at 5% significance level
Test Decision: Fail to reject null in favor of alternative at 5% significance level
*/

// Test whether distribution has median of five:
Expand All @@ -54,12 +54,12 @@ out = wilcoxon( arr, {
});
console.log( out.print() );
/* e.g, =>
One-Sample Wilcoxon signed rank test
One-Sample Wilcoxon signed rank test

Alternative hypothesis: Median of `x` is not equal to 5
Alternative hypothesis: Median of `x` is not equal to 5

pValue: 0.0529
statistic: 1961.5
pValue: 0.0529
statistic: 1961.5

Test Decision: Fail to reject null in favor of alternative at 5% significance level
Test Decision: Fail to reject null in favor of alternative at 5% significance level
*/