Code covered by the BSD License  

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

Be the first to rate this file! 3 Downloads (last 30 days) File Size: 1.33 KB File ID: #26541

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

by Andrea Padoan

 

30 Jan 2010

It's a very simple code, useful if you need to calculate p-value inside routine or software.

| Watch this File

File Information
Description

Input:
z value

Output:
One tail and two tail p-value.

MATLAB release MATLAB 7.8 (R2009a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
01 Feb 2010 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.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
statistics Andrea Padoan 01 Feb 2010 10:59:05
standardized distribution Andrea Padoan 01 Feb 2010 10:59:05

Contact us at files@mathworks.com