{"id":42399988,"url":"https://github.com/egusahiroaki/statsmodels-js","last_synced_at":"2026-01-28T01:16:48.807Z","repository":{"id":46899018,"uuid":"259281430","full_name":"egusahiroaki/statsmodels-js","owner":"egusahiroaki","description":"JavaScript Statistical Libraries","archived":false,"fork":false,"pushed_at":"2022-12-11T03:46:02.000Z","size":2224,"stargazers_count":2,"open_issues_count":10,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T10:23:35.680Z","etag":null,"topics":["descriptive-statistics","javascript","math","statistic"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/statsmodels-js","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egusahiroaki.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-27T10:31:44.000Z","updated_at":"2025-03-24T20:01:45.000Z","dependencies_parsed_at":"2023-01-26T16:16:15.606Z","dependency_job_id":null,"html_url":"https://github.com/egusahiroaki/statsmodels-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/egusahiroaki/statsmodels-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egusahiroaki%2Fstatsmodels-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egusahiroaki%2Fstatsmodels-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egusahiroaki%2Fstatsmodels-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egusahiroaki%2Fstatsmodels-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egusahiroaki","download_url":"https://codeload.github.com/egusahiroaki/statsmodels-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egusahiroaki%2Fstatsmodels-js/sbom","scorecard":{"id":369496,"data":{"date":"2025-08-11","repo":{"name":"github.com/egusahiroaki/statsmodels-js","commit":"263ce8c3c14abef1f539e8ba3f538d89bf0c5fbd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"66 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-r9p9-mrjm-926w","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-x2fc-mxcx-w4mf","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-93f3-23rq-pjfp","Warn: Project is vulnerable to: GHSA-jmqm-f2gx-4fjv","Warn: Project is vulnerable to: GHSA-pw54-mh39-w3hc","Warn: Project is vulnerable to: GHSA-xgh6-85xh-479p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-hxcc-f52p-wc94","Warn: Project is vulnerable to: GHSA-vx3p-948g-6vhq","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T12:39:01.354Z","repository_id":46899018,"created_at":"2025-08-18T12:39:01.354Z","updated_at":"2025-08-18T12:39:01.354Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"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":["descriptive-statistics","javascript","math","statistic"],"created_at":"2026-01-28T01:16:48.137Z","updated_at":"2026-01-28T01:16:48.799Z","avatar_url":"https://github.com/egusahiroaki.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# statsmodels-js\n[![npm version](https://badge.fury.io/js/statsmodels-js.svg)](https://badge.fury.io/js/statsmodels-js)  [![Build Status](https://travis-ci.org/egusahiroaki/statsmodels-js.svg?branch=master)](https://travis-ci.org/egusahiroaki/statsmodels-js) [![Coverage Status](https://coveralls.io/repos/github/egusahiroaki/statsmodels-js/badge.svg?branch=master)](https://coveralls.io/github/egusahiroaki/statsmodels-js?branch=master) ![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg) \n\n\n\nA JavaScript implementation of statistics methods.\n\n## install\n\n    npm install statsmodels-js\n\n\n\n## How to use\n\n### Statistics\n\nbasic statistical summary\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\n\nconst result = Stats.descripeStats([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]);\n\n/*\n{\n  size: 10,\n  min: 0,\n  max: 9,\n  mean: 4.5,\n  se: 0.9082951062292475,\n  variance: 9.166666666666666,\n  skewness: 0,\n  kurtosis: -1.2\n}\n*/\n```\n\n### Correlation\n\nPearson correlation coefficient\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\n\nconst a = [0, 0, 0, 1, 1, 1, 1];\nconst b = [0, 1, 2, 3, 4, 5, 6];\nconst result = Stats.pearsonr(a, b);\n\n/*\n{\n  r: 0.8660254037844386\n  pValue: 0.011724811003882547\n}\n*/\n```\n\n### Similarity\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\n\nconst a = [1, 1];\nconst b = [0, 1];\nconst result1 = Stats.cosSimilarity(a, b);\n// 0.7071067811865475\n\nconst a = [1, 1];\nconst b = [1, 1];\nconst result2 = Stats.cosSimilarity(a, b);\n// 1\n```\n\n### Statistical Test\n\n\n#### unpaired T-Test\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\n\n// test assumes that the variances of both populations are equal.\nconst result1 = Stats.tTestInd([4, 5, 6, 4, 5], [1, 2, 3, 4, 5], true);\n/*\n  {\n    statistic: 2.2499999999999996,\n    se: 1.2649110640673518,\n    df: 8,\n    pValue: 0.054567305799939875\n  }\n*/\n\n// test doesn't assumes that the variances of both populations are equal.\nconst result2 = Stats.tTestInd([4, 5, 6, 4, 5], [1, 2, 3, 4, 5], false);\n/*\n  {\n    statistic: 2.2499999999999996,\n    se: 0.8,\n    df: 6.077151335311573,\n    pValue: 0.06488370852885418\n  }\n*/\n```\n\n#### T-test for the mean of ONE group of scores.\n\n```javascript\nconst result = Stats.tTest1Sample([5, 5, 5, 5, 5, 5, 6, 10], 5.0);\n/*\n  {\n    mean: 5.75,\n    sd: 1.6393596310755,\n    statistic: 1.2104198771788937,\n    pValue: 0.26539803962501435\n  }\n*/\n```\n\n#### T-test for 2 related or repeated samples\n\n```javascript\nconst result = tTestRel([4, 5, 6, 4, 5], [1, 2, 3, 4, 5]);\n/*\n  {\n    statistic: 2.449489742783178,\n    pValue: 0.07048399691022006\n  }\n*/\n```\n\n#### Chi-squared test\n\ngoodness-of-fit test\n\n```javascript\nconst result = chiSqaure([10, 1, 1, 1], [15, 1, 1, 1]);\n\n/*\n  {\n    statistic: 1.6666666666666667,\n    pValue: 0.6443698056370236\n  }\n*/\n```\n\ntest for independence\n\n```javascript\nconst result = chi2Contingency([55, 22, 16, 7], [40, 32, 24, 4]);\n\n/*\n  {\n    statistic: 6.63845472266525,\n    pValue: 0.08435923449835192\n  }\n*/\n```\n\n#### One-Way ANOVA Test\n\nThe one-way ANOVA tests the null hypothesis that two or more groups have the same population mean. \n\n```javascript\nconst a = [5, 6, 5, 5, 7];\nconst b = [6, 6, 7, 5, 6];\nconst result = Stats.oneWayANOVA(a, b);\n// { statistic: 0.6153846153846155, pValue: 0.45536634355271177 }\n```\n\n```javascript\nconst a = [66, 62, 80, 50, 57, 68, 73, 65];\nconst b = [62, 60, 66, 63, 55, 53, 59, 63];\nconst c = [65, 60, 78, 52, 59, 66, 73, 64];\nconst d = [52, 59, 44, 67, 47, 53, 58, 49];\nconst result = oneWayANOVA(a, b, c, d);\n/*\n  {\n    statistic: 4.024870903151017,\n    pValue: 0.01685989800789034\n  }\n*/\n```\n\n\n### Linear Regression\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\nconst x = [1, 2, 3];\nconst y = [3, 5, 7];\n\nconst result = new Stats.SimpleLinearRegression(x, y).fit();\nresult.summary()\n/*\n{\n  r2Score: 0.9642857142857142,\n  coef: 1.5,\n  intercept: 0.3333333333333333\n}\n*/\n\n// prediction\nresult.predict([10, 20, 30]);\n// [ 21, 41, 61 ]\n```\n\n```javascript\nconst Stats = require(\"statsmodels-js\");\nconst x = [\n  [10, 20, 30],\n  [20, 42, 63],\n  [4, 8, 16],\n];\nconst y = [30, 50, 70];\n\nconst result = new Stats.MultipleLinearRegression(x, y).fit();\nresult.summary()\n/*\n{\n  x1: -5.419270833334926,\n  x2: -14.610026041665915,\n  x3: 11.98828125,\n  intercept: 16.74479166666713,\n  r2Score: 1\n}\n*/\n\n/* prediction case 1 */\nresult.predict([10, 20, 30])\n// [[29.999999999999545]]\n\n/* prediction case 2 */\nresult.predict([\n  [10, 20, 30],\n  [1, 2, 3],\n]);\n/*\n  [[29.999999999999545], [18.070312500000373]];\n*/\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegusahiroaki%2Fstatsmodels-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegusahiroaki%2Fstatsmodels-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegusahiroaki%2Fstatsmodels-js/lists"}