mms...@comcast.net <mms...@comcast.net> [Mon, Nov 01, 2010 at 04:11:53AM CET]: > Hello, > > What I really want to do is to add a rejection region in the > form of a long rectangle to a density plot I have drawn. > I am getting 2 plots. > > How can I add rectangle to first plot? see code below. > First section works fine. It just is not quite what I want. > > # NORMAL DISTRIBUTION PLOT OF RAW DATA WITH UPPER CRITICAL LEVEL - ok > xcrit=144.1 > # *** single-sample Upper one-tailed hypothesis Test, z statistic *** > cord.x <- c(xcrit,seq(xcrit,200,0.01),200) > cord.y <- c(0,dnorm(seq(xcrit,200,0.01),140,15),0) > curve(dnorm(x,140,15),xlim=c(80,200),main='Normal PDF',ylab="Probability") > polygon(cord.x,cord.y,col='orange') >
Another call to polygon()? polygon(rep(c(144.1, 200), each=2), rep(c(0, .03, .03, 0))) -- Johannes Hüsing There is something fascinating about science. One gets such wholesale returns of conjecture mailto:johan...@huesing.name from such a trifling investment of fact. http://derwisch.wikidot.com (Mark Twain, "Life on the Mississippi") ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.