https://github.com/diversen/zscore-probability
The following functions calculate probability from a z-score and z-score from a probability.
https://github.com/diversen/zscore-probability
z-score z-table
Last synced: 6 months ago
JSON representation
The following functions calculate probability from a z-score and z-score from a probability.
- Host: GitHub
- URL: https://github.com/diversen/zscore-probability
- Owner: diversen
- Created: 2021-08-05T10:57:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-08-08T09:32:40.000Z (about 4 years ago)
- Last Synced: 2025-03-18T16:57:01.021Z (7 months ago)
- Topics: z-score, z-table
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zscore-probability
The following functions calculate probability from a z-score and z-score from a probability.
## Install
npm install --save zscore-probability
See [test.js](test.js) for a couple of examples.
## About the code
Found on [https://stackoverflow.com/a/36903699/464549](https://stackoverflow.com/a/36903699/464549)
Original code comments:
The following JavaScript functions for calculating normal and
chi-square probabilities and critical values were adapted by
John Walker from C implementations
written by Gary Perlman of Wang Institute, Tyngsboro, MA
01879. Both the original C code and this JavaScript edition
are in the public domain. */POZ -- probability of normal z value
Adapted from a polynomial approximation in:
Ibbetson D, Algorithm 209
Collected Algorithms of the CACM 1963 p. 616
Note:
This routine has six digit accuracy, so it is only useful for absolute
z values <= 6. For z values > to 6.0, poz() returns 0.0.CRITZ -- Compute critical normal z value to
produce given p. We just do a bisection
search for a value within CHI_EPSILON,
relying on the monotonicity of pochisq().## License
MIT © [Dennis Iversen](https://github.com/diversen)