Skip to content

Main content

Wilcoxon Signed-Rank Test Calculator Source Code

Browse the implementation files for Wilcoxon Signed-Rank Test Calculator.
tool.ts typescript
import { calculateWilcoxonSignedRank as calculatePortableWilcoxon } from '@tool.io/tools/statistics/wilcoxon-signed-rank';

export const calculateWilcoxonSignedRank = (
	first: unknown,
	second: unknown
): string => {
	const result = calculatePortableWilcoxon({ first, second });
	return result.ok
		? JSON.stringify(result.output, null, 2)
		: '';
};

export const Tool: TypeTool = {
	name: 'Wilcoxon Signed-Rank Test Calculator',
	slug: 'statistics/wilcoxon-signed-rank',
	intro:
		'Calculate a two-sided Wilcoxon signed-rank statistic for matched samples.',
	tool: calculateWilcoxonSignedRank,
	i: [
		{
			example: '10, 12, 9, 11, 13',
			label: 'First Sample',
			placeholder: 'First matched series',
			render: 'textarea',
			type: 'text'
		},
		{
			example: '8, 11, 10, 9, 12',
			label: 'Second Sample',
			placeholder: 'Second matched series',
			render: 'textarea',
			type: 'text'
		}
	],
	o: [
		{
			example: '{ "statistic": 1.5 }',
			label: 'Signed-Rank Result',
			placeholder: 'Result will appear here...',
			render: 'textarea',
			type: 'text'
		}
	]
};

export default Tool;

Description

Browse the implementation files for Wilcoxon Signed-Rank Test Calculator.

References

  1. Tool.io on GitHub
  2. Tool.io TypeScript tools library

Similar or alternative tools