File Exchange

image thumbnail

Return a p-value from a given z (standardized distribution)

version 1.0.0.0 (1.33 KB) by Andrea Padoan
It's a very simple code, useful if you need to calculate p-value inside routine or software.

6 Downloads

Updated 30 Jan 2010

View License

Input:
z value

Output:
One tail and two tail p-value.

Cite As

Andrea Padoan (2021). Return a p-value from a given z (standardized distribution) (https://www.mathworks.com/matlabcentral/fileexchange/26541-return-a-p-value-from-a-given-z-standardized-distribution), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Cameron Hanan

Jos (10584)

Keep the name, but change the engine by using the more robust ERFC function:

p = 0.5 * erfc(-z ./ sqrt(2))

Do not print the results out on the screen as well, but just return them as an output argument.

Finally, re-design the help section (add H1 line, used by lookfor), a description of the inputs and outputs, an example and a see also line.

MATLAB Release Compatibility
Created with R2009a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!