How to convert a Z Score to a P Value?

A Z Score to P Value conversion is a statistical process that converts the number of standard deviations away from the mean into a probability value. The greater the number of standard deviations away from the mean, the smaller the probability value. It is used to determine the likelihood that a result is due to chance rather than a true relationship.

@import url(‘https://fonts.googleapis.com/css?family=Droid+Serif|Raleway’);

.axis–y .domain {
display: none;
}

h1 {
text-align: center;
font-size: 50px;
margin-bottom: 0px;
font-family: ‘Raleway’, serif;
}

p {
color: black;
text-align: center;
margin-bottom: 15px;
margin-top: 15px;
font-family: ‘Raleway’, sans-serif;
}

#words {
color: black;
font-family: Raleway;
max-width: 550px;
margin: 25px auto;
line-height: 1.75;
padding-left: 100px;
}

#calcTitle {
text-align: center;
font-size: 20px;
margin-bottom: 0px;
font-family: ‘Raleway’, serif;
}

#hr_top {
width: 30%;
margin-bottom: 0px;
border: none;
height: 2px;
color: black;
background-color: black;
}

#hr_bottom {
width: 30%;
margin-top: 15px;
border: none;
height: 2px;
color: black;
background-color: black;
}

#words label, input {
display: inline-block;
vertical-align: baseline;
width: 350px;
}

#button {
border: 1px solid;
border-radius: 10px;
margin-top: 20px;
padding: 10px 10px;
cursor: pointer;
outline: none;
background-color: white;
color: black;
font-family: ‘Work Sans’, sans-serif;
border: 1px solid grey;
/* Green */
}

#button:hover {
background-color: #f6f6f6;
border: 1px solid black;
}

.label_radio {
text-align: center;
}

One-tailed or two-tailed hypothesis?

Significance level

P-value: 0.38209

The result is NOT SIGNIFICANT at p < 0.05

//the following function originated from https://stackoverflow.com/questions/16194730/seeking-a-statistical-javascript-function-to-return-p-value-from-a-z-score/30435852

function GetZPercent()
{
var z_input = document.getElementById(‘z’).value*1;
var z = Math.abs(z_input);

//if z is greater than 6.5 standard deviations from the mean
//the number of significant digits will be outside of a reasonable
//range
if ( z 6.5)
return 1.0;

var factK = 1;
var sum = 0;
var term = 1;
var k = 0;
var loopStop = Math.exp(-23);
while(Math.abs(term) > loopStop)
{
term = .3989422804 * Math.pow(-1,k) * Math.pow(z,k) / (2 * k + 1) / Math.pow(2,k) * Math.pow(z,k+1) / factK;
sum += term;
k++;
factK *= k;

}
sum += 0.5;

var p_value = 1 – sum;

//get tails input
if (document.getElementById(‘two_tailed’).checked) {
p_value = p_value * 2;
}

//get significance level input
var sig_level = ”;
if (document.getElementById(‘one’).checked) {
sig_level = 0.01;
} else if (document.getElementById(‘five’).checked) {
sig_level = 0.05;
} else {
sig_level = 0.10;
}

//get significance verdict
var sig_verdict = ”;
if (p_value < sig_level) {
sig_verdict = 'SIGNIFICANT';
} else {
sig_verdict = 'NOT SIGNIFICANT';
}

//output values
document.getElementById('exactProb').innerHTML = p_value.toFixed(5);
document.getElementById('sig_level').innerHTML = sig_level.toFixed(2);
document.getElementById('sig_verdict').innerHTML = sig_verdict;
}

x