z = (x-mu)/sigma
.
In particular, the probability a normal random variable x
with mean mu and standard deviation sigma
is between numbers a
and b
is equal to the probability that a standard normal random variable z
is between (a-mu)/sigma
and (b-mu)/sigma
.
pnorm
which calculates the probability that the normal random variable
is x
or lower
and qnorm
which finds the p
th quantile of a distribution.
The ``p'' in pnorm
refers to ``probability''
and the ``q'' in qnorm
refers to ``quantile''.
You will also load in a local function gnorm
to graph normal distributions
for different parameter values.
> pnorm(x,mu,sigma)is the area to the left of
x
under a normal curve with mean mu
and standard deviation sigma
.
> pnorm(x)is the area to the left of
x
under the standard normal curve.
> qnorm(p,mu,sigma)is the number
x
for which the area to the left of x
under a normal curve with mean mu
and standard deviation sigma
is p
.
> qnorm(p)is the number
x
for which the area to the left of x
under the standard normal curve is p
.
S-PLUS help is available in this on-line guide.
> pnorm(90,100,10)
> 1 - pnorm(120,100,10)
> pnorm(120,100,10) - pnorm(90,100,10)
> pnorm(-1) > 1 - pnorm(2) > pnorm(2) - pnorm(-1)
> qnorm(0.25,500,100) > qnorm(0.75,500,100)
> pnorm(1) - pnorm(-1) > pnorm(2) - pnorm(-2) > pnorm(3) - pnorm(-3)Now check it again with
mu=100
and sigma=15
.
> pnorm(115,100,15) - pnorm(85,100,15) > pnorm(130,100,15) - pnorm(70,100,15) > pnorm(145,100,15) - pnorm(55,100,15)
gnorm
by following these steps.
gnorm
link above.
gnorm.ssc
.
You may need to change the box ``Look in'' to Desktop
and the box ``File type'' to either all files or *.ssc files.
This opens up a Script Window.
gnorm
into S-PLUS.
mu=500
and sigma=100
.
> gnorm(500,100)
mu=500
and sigma=100
and display the area between 400 and 600.
> gnorm(500,100,prob=T,a=400,b=600)
mu=500
and sigma=100
and find the 0.01 quantile.
> gnorm(500,100,quantile=T,p=0.01)
gnorm
into S-PLUS
(if it has not already been done)
and answer the questions below.
You should write your answers on
this form
and turn it in to your lab instructor by the due date.
Further S-PLUS help is available in this on-line guide.
If sigma=sqrt(n*p*(1-p))
is at least three or so,
exact binomial probabilities
may be approximated by areas under a normal curve
where mu=n*p
and sigma=sqrt(n*p*(1-p))
.
The probability of exactly x
successes
would be approximated by the area from x-0.5
to x+0.5
under a normal curve with mean and standard deviation as above.
The exact probability Prob(a < x < b)
would then be approximated by the area between a+0.5
and b-0.5
.
Note that with a computer,
it is preferable to simply make the exact binomial calculation.
Without a computer,
the exact binomial calculation
requires computing many individual binomial probabilities,
whereas the normal approximation calculation is relatively short.
(Hint:
The mean of the binomial distribution is 1200*0.1
.
The standard deviation of the binomial distribution is sqrt(1200*0.1*0.9)
.
The probability of 140 or more successes is approximated as the area to the right
of 139.5 under the normal curve with mean and standard deviation in agreement
with the binomial distribution.)
Bret Larget, larget@mathcs.duq.edu