Bookmark this: tool.io/statistics/bootstrap-standard-error/source-code
Bootstrap Standard Error Calculator Source Code
Browse the implementation files for Bootstrap Standard Error Calculator.tool.ts typescript
import { calculateBootstrapStandardError as calculatePortableBootstrap } from '@tool.io/tools/statistics/bootstrap-standard-error';
export const calculateBootstrapStandardError = (
values: unknown,
resamples: unknown,
statistic: unknown
): string => {
const result = calculatePortableBootstrap({
resamples: Number(resamples),
statistic: statistic === 'median' ? 'median' : 'mean',
values
});
return result.ok
? JSON.stringify(result.output, null, 2)
: '';
};
export const Tool: TypeTool = {
name: 'Bootstrap Standard Error Calculator',
slug: 'statistics/bootstrap-standard-error',
intro:
'Estimate the standard error of a sample statistic with bootstrap resampling.',
tool: calculateBootstrapStandardError,
i: [
{
example: '2, 4, 6, 8, 10',
label: 'Sample',
placeholder: 'Numeric values',
render: 'textarea',
type: 'text'
},
{
example: '1000',
label: 'Resamples',
placeholder: 'Number of bootstrap samples',
type: 'number'
},
{
label: 'Statistic',
options: [
{ selected: true, text: 'Mean', value: 'mean' },
{ text: 'Median', value: 'median' }
],
placeholder: 'Select a statistic',
type: 'select',
value: 'mean'
}
],
o: [
{
example: '{ "standardError": 1.2 }',
label: 'Bootstrap Result',
placeholder: 'Result will appear here...',
render: 'textarea',
type: 'text'
}
]
};
export default Tool;
Description
Browse the implementation files for Bootstrap Standard Error Calculator.