# Probability plot: calculating the confidence interval

#### tilo

##### New Member
Hi,

I need to program a function that displays a probability plot for a normal distribution with a confidence interval. I could find sufficient information in the Internet on probability plots, but I couldn't find a page that explains how a confidence interval is calculated, nor even what exactly it means.

Tilo

#### tilo

##### New Member
Sorry, perhaps I didn't explain clearly enough what I'm looking for. It's not about confidence intervals in general. I'm interested in the confidence intervals which are displayed as curves on probability plots. The attached image shows what I mean.

#### vinux

##### Dark Knight
Sorry, perhaps I didn't explain clearly enough what I'm looking for. It's not about confidence intervals in general. I'm interested in the confidence intervals which are displayed as curves on probability plots. The attached image shows what I mean.
Hi tilo,
PP plot is constructed in this way. This is an approximate solution.
X axis will be your variable ( take the limits from X-4sd to X +4 sd)
Preparing Y axis is slightly complicated.
It will be the percentile values. So the legth of the intervel will not be same. but it will symmetric from 50 ( above and below).
take any fixed units i am calling it as d ( it may be 3 cm ,10 cm or 10 inch , it depends on the size of the graph)
start Y axis from 1 ( max 99)
If K <50
then length between 1 to K will be = [ 2.35 + inv cum. std normal prob(k/100) ] * d Since { P [ X >2.35 ] = 0.01}
IF K>50
length between 50 to K will be = [ inv cum. std normal prob(k/100) ] * d

Now sort the data and calculate the cumilative empirical distribution. ( there is a small correction in the cumilative probablities, it will not start with 0 and end with 1 . it will be very negligible if you have large data)
And for each value of variable you will have empirical cum prob.
so you can plot it .
and theoretical prob is a straight line pass through ( mean ,50) and
(mean- 0.2533*sd ,40) { P[ mean < X < mean -0.2533*sd] =.10 }
ie
PLOT[ X, 100*inverse cum normal ( X , mu =mean , var = sd*sd) ]
( Not standard normal)
and confidence interval will be
for 95 % confidence interval, ta = 1.96
PLOT[X,inverse cum normal ( X +or - 1.96*sd/sqrt(n) , mu =mean , var = sd*sd) ]
I know that there will be some typo error in this.. But You have to offer me a Beer for next queries
Vinux

Hi Vinux,