\begin{Schunk}
\begin{Sinput}
  m=-7.1; sd=11;
  xrange <- c(m-4*sd, m+4*sd)
  xseq <- seq( xrange[1], xrange[2], length.out=100)
  xnaught <- 3
  dxseq <- dnorm(xseq, m=m, sd=sd)
  plot(dxseq ~ xseq, type="l", ylim=c(0,1.2* max(dxseq)), xlab="x",ylab=paste("dnorm(x, m=",m,", sd=",sd,")"), main=paste("Shaded Area = Probability of x Smaller than",xnaught,")"))
  segments(xnaught,0,xnaught, dnorm(xnaught, m=m, sd=sd), lty=2)
  polygon(c(xseq[xseq < xnaught], xnaught, xnaught, min(xseq)), c(dxseq[xseq < xnaught], dnorm(xnaught, m=m, sd=sd), 0, 0), col=gray(0.95))
  area <- round(pnorm(xnaught, m=m, sd=sd),2)
  text(-15, 0.001, paste("Area= ",area,"= \n pnorm(",xnaught,", m=",m,", sd=",sd,")",sep=""),pos=3)
\end{Sinput}
\end{Schunk}
