Z-Score to Percentile Formula?

I am looking for a formula to convert a z-score into the percentile or confidence interval.

for example a z-score of 1 would give 68%, a z-score of 2 would give 95%

what is the formula/equation for this?

I do not want to use an online z-score to percentile calculator, and I do not want to use a table or graph. I want to use a formula to convert my z-score to a percentile.

Re: Z-Score to Percentile Formula?

To find the area *A* under the standard normal curve between two *z*scores symmetric about the mean, you can use:

Note: this will require numeric integration to obtain an approximation.

You may also use Taylor polynomials to approximate this as well.

Re: Z-Score to Percentile Formula?

G-day MarkFL2, cheers for putting up this equation, I've been scouring the web for hours looking for this. I was wondering if you might be able to clarify it a bit, I attempting to use the standard deviation and mean from some data to classify the probability (as a %) that a new value belongs to that data, i can calculate the z score (by subtracting the mean from the potential new value and dividing by SD) but need to use an equation to convert the z score to a % as my data-set has approximately 40 billion points ruling out the manual table method (i could use some kind of automated table lookup but a smaller equation would be preferable). For this purpose is the equation above the equation i should be using? if so I'm assuming in the equation z is the calculated z score and x is the new potential value but what do the e and dx signify? i know this has something to do with anti-derivatives but everything i look at on the net regarding these makes my brain hurt, can you dumb it down a notch? or point be in the right direction to a site that does?

P.S. If any other lads or ladies out there have any idea's please let me know

Re: Z-Score to Percentile Formula?

The equation I gave will give you the area between -z and z. x is a "dummy" variable, dx is the differential, and e is a noteworthy transcendental constant (the base of the natural logarithm). I am assuming you are using a programming language, and it may have an intrinsic function that will calculate this for you.

Re: Z-Score to Percentile Formula?

I am using some programing language but I'd really like to wrap my head around the maths beforehand. I'm afraid my knowledge of calculus is rather infantile (i.e. a couple of hours so far) but i think I follow that the equation is finding the anti-derivative of the equation/function of a bell curve, or in this case a segment of a bell curve as defined by the upper and lower levels of integration (0 and z), i reckon whats throwing me is the equation for the bell curve, would it be possible for you to put up the original function you used for the bell curve (as the ones on the net are confusing in the context of this equation) and explain how you rearranged it?

P.S. apologies for my mathematical incompetence...

Re: Z-Score to Percentile Formula?

Hi Mattrnfnr! :)

Using functions that are available on graphical calculators, the formula would be:

The inverse is:

So if you want a 95% confidence interval, you need:

Btw, the normcdf(z) function is defined as:

Another name for the same function is .

This is the formula Mark referred to (with a few slight modifications... ;))

4 Attachment(s)

Re: Z-Score to Percentile Formula?

It’s handy to know how to double check using the graphics calculator for small data-sets but I have 40 billion data points and need to write code using the underlying mathematics, this is where my issue is I need to interpret the equation in a way that I can use, such that I can calculate the % confidence interval associated with the z value for the given data point in a given data-set.

If I'm going to calculate a value i can't use an equation with infinity in it:

Attachment 27062

So I'd have to use the original equation:

Attachment 27061

but i don't understand how to interpret it as something in which i can put values:

I understand this segment:

Attachment 27064

(Although I've no idea why I'm taking the square root of 2 divided by pi)

but not this segment:

Attachment 27065

i have the z value, the sample size, the mean, standard deviation and the subject data value and need the confidence as a % that the subject data value fits the trend...

Re: Z-Score to Percentile Formula?

The proper bell curve with a mean and a standard deviation is (see wiki):

The constant is wrong. It is a typo.

The reason for the is to make sure that when all possible z-values are integrated (from to ), we find a probability of exactly 1.

Your 95% interval corresponds with:

The corresponding z-value is .

The section is the exponential function.

An alternative way to write it, is: .

All programming languages support this function.

Re: Z-Score to Percentile Formula?

So if I understand correctly (and history suggests I don’t) an equation for the % confidence that a new value belongs to the data-set, would vaguely resemble:

[1/(SQRT(2*π))]*[(exp(-(1/2*(+z^2)))) - (exp(-(1/2*(-z^2))))]

Where z = ((new value – mean of existing data)/standard deviation of the existing data)

Re: Z-Score to Percentile Formula?

Quote:

Originally Posted by

**ILikeSerena** ...

The constant

is wrong. It is a typo...

Just so the OP understands, I used the even function rule to state:

Re: Z-Score to Percentile Formula?

Quote:

Originally Posted by

**MarkFL2** Just so the OP understands, I used the even function rule to state:

Oops. Sorry. It was not a typo. (Lipssealed)

Re: Z-Score to Percentile Formula?

Quote:

Originally Posted by

**Mattrnfnr** So if I understand correctly (and history suggests I don’t) an equation for the % confidence that a new value belongs to the data-set, would vaguely resemble:

[1/(SQRT(2*π))]*[(exp(-(1/2*(+z^2)))) - (exp(-(1/2*(-z^2))))]

Where z = ((new value – mean of existing data)/standard deviation of the existing data)

Hmm, you left out the integral sign.

It means the result will be wrong.

You would get something with an expression in (+z) from which you subtract the same expression in (-z).

And yes, this is more or less how the formula can be programmed in a programming language.

You do need to take care with the parentheses.

As it is you need a couple of extra near -z: it should be (-z)^2 instead of just -z^2.

Let's take a look at an example.

Suppose you have z=1.

Then the corresponding confidence interval has a probability of 68%.

If we fill it in in your formula, we'd get:

[1/(SQRT(2*π))]*[(exp(-(1/2*((+1)^2)))) - (exp(-(1/2*((-1)^2))))]

= [1/(SQRT(2*π))]*[exp(-1/2) - exp(-1/2)]

= [1/(SQRT(2*π))]*[ 0 ]

= 0

No, this does not look like the right result.

Re: Z-Score to Percentile Formula?

I'm not sure what you mean by 'left out the integral sign', isn't this expression [(exp(-(1/2*((+1)^2)))) - (exp(-(1/2*((-1)^2))))] equivalent to the integral section? the upper integration limit plugged into the expression after the integral sign - the lower integration limit plugged into the expression after the integral sign?

I see I'm getting the wrong value, I'm just not sure what i need to do about it...

Re: Z-Score to Percentile Formula?

P.S. once again i apologize for my tenuous grasp of mathematics...

Re: Z-Score to Percentile Formula?

Quote:

Originally Posted by

**Mattrnfnr** I see I'm getting the wrong value, I'm just not sure what i need to do about it...

Find a library that calculates the normcdf function I mentioned earlier.