{"id":17398434,"url":"https://github.com/vweevers/student-histogram","last_synced_at":"2026-01-20T19:31:38.593Z","repository":{"id":57373082,"uuid":"108109952","full_name":"vweevers/student-histogram","owner":"vweevers","description":"Record a sample and compute its statistical significance.","archived":false,"fork":false,"pushed_at":"2023-11-01T02:34:55.000Z","size":20,"stargazers_count":2,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T04:39:05.868Z","etag":null,"topics":["histogram","nodejs","npm-package","statistics","student-t"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vweevers.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-24T10:10:35.000Z","updated_at":"2022-11-01T22:29:49.000Z","dependencies_parsed_at":"2024-10-23T03:24:55.743Z","dependency_job_id":null,"html_url":"https://github.com/vweevers/student-histogram","commit_stats":{"total_commits":16,"total_committers":2,"mean_commits":8.0,"dds":0.125,"last_synced_commit":"79ef7fde563ab45f9c676a6f0eef289a5c752102"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/vweevers/student-histogram","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fstudent-histogram","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fstudent-histogram/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fstudent-histogram/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fstudent-histogram/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vweevers","download_url":"https://codeload.github.com/vweevers/student-histogram/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vweevers%2Fstudent-histogram/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28610606,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T18:56:40.769Z","status":"ssl_error","status_checked_at":"2026-01-20T18:54:26.653Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["histogram","nodejs","npm-package","statistics","student-t"],"created_at":"2024-10-16T14:56:24.066Z","updated_at":"2026-01-20T19:31:38.562Z","avatar_url":"https://github.com/vweevers.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# student-histogram\n\n**Record a sample and compute its statistical significance.** Uses [`native-hdr-histogram`][native-hdr-histogram] and a two-tailed t-distribution table under the hood. Good for sample sizes below 200. HDR histogram is designed for \"value measurements in latency and performance sensitive applications\", quantizes values with a configurable precision and has a constant memory footprint.\n\n[![npm](https://img.shields.io/npm/v/student-histogram.svg)](https://www.npmjs.com/package/student-histogram)\n[![Node version](https://img.shields.io/node/v/student-histogram.svg)](https://www.npmjs.com/package/student-histogram)\n[![Test](https://img.shields.io/github/workflow/status/vweevers/student-histogram/Test?label=test)](https://github.com/vweevers/student-histogram/actions/workflows/test.yml)\n[![Standard](https://img.shields.io/badge/standard-informational?logo=javascript\u0026logoColor=fff)](https://standardjs.com)\n\n## Example\n\n```js\nconst StudentHistogram = require('student-histogram')\nconst h = new StudentHistogram(1, 200, 3)\n\n// Record some example values.\nconst sample = [100, 120, 101, 103, 99]\nsample.forEach(v =\u003e h.record(v))\n\nconst log = console.log\nconst percent = require('fixed-number')(1, 2, 'percent')\n\nlog('arithmetic mean            : %d ±%s', h.mean(), percent(h.rme()))\nlog('standard deviation         :', h.stddev())\nlog('minimum and maximum        : %d and %d', h.min(), h.max())\nlog('75% of values fall below   :', h.percentile(75))\nlog()\n\nlog('standard error of the mean :', h.sem())\nlog('margin of error            :', h.moe())\nlog('relative margin of error   :', h.rme())\nlog('with higher confidence     :', h.rme(0.998))\nlog()\n\n// Estimate the size (number of sampling points aka recorded values)\n// that is required to achieve a relative margin of error of 0.05.\nlog('recommended sample size    :', h.minimumSize(0.05))\nlog('for 99.5% confidence       :', h.minimumSize(0.05, 0.995))\nlog('with 10% error tolerance   :', h.minimumSize(0.10))\n\nif (h.size \u003c h.minimumSize(0.05)) {\n  // Maybe record some more!\n}\n```\n\nOutput:\n\n```\narithmetic mean            : 104.6 ±9.27%\nstandard deviation         : 7.812809993849844\nminimum and maximum        : 99 and 120\n75% of values fall below   : 103\n\nstandard error of the mean : 3.493994848307593\nmargin of error            : 9.700727296841201\nrelative margin of error   : 0.09274117874609179\nwith higher confidence     : 0.23960921458776316\n\nrecommended sample size    : 18\nfor 99.5% confidence       : 70\nwith 10% error tolerance   : 5\n```\n\n## API\n\n### `StudentHistogram(min, max, figures, opts)`\n\nDocumentation to follow.\n\n## Install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install student-histogram\n```\n\n## See also\n\n- [`hdr-histogram-percentiles-obj`][hdr-histogram-percentiles-obj] (`student-histogram` is compatible)\n\n## License\n\n[MIT](LICENSE) © 2017-present Vincent Weevers. Based in part on [`benchmark.js`][benchmark-js] and [`sample-sizer`][sample-sizer]. See included [`LICENSE`](LICENSE) file for all copyright owners.\n\n[benchmark-js]: https://github.com/bestiejs/benchmark.js\n[sample-sizer]: https://github.com/mapbox/sample-sizer\n[native-hdr-histogram]: https://github.com/mcollina/native-hdr-histogram\n[hdr-histogram-percentiles-obj]: https://github.com/thekemkid/hdr-histogram-percentiles-obj\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fstudent-histogram","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvweevers%2Fstudent-histogram","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvweevers%2Fstudent-histogram/lists"}