# Re: [R] How to shadow 'power' area?

From: Christos Hatzis <christos_at_nuverabio.com>
Date: Mon, 25 Jun 2007 17:00:40 -0400

This should be pretty close to what you want. HTH -Christos

> -----Original Message-----
> From: r-help-bounces_at_stat.math.ethz.ch
> [mailto:r-help-bounces_at_stat.math.ethz.ch] On Behalf Of Andrej Kastrin
> Sent: Monday, June 25, 2007 4:51 PM
> To: R-help
> Subject: [R] How to shadow 'power' area?
>
> Dear all,
>
> Suppose I plot two normal distributions (A and B) side by
> side and add vertical line which hipotheticaly represent
> alpha value; e.g.:
>
> x <- seq(-3.5,5, length=1000)
> y <- dnorm(x)
> # Plot distribution A
> plot(y~x, type='l',axes=F,xlab="",ylab="",lwd=2)
> # Plot distribution B
> y2 <- dnorm(x-1.5)
> lines(y2~x,lwd=2)
> # Plot vertical line for alpha value
> abline(h=0)
> segments(qnorm(.5)+1.5,0,qnorm(.5)+1.5,dnorm(qnorm(.5)))
> text(2,0.2,"Power")
>
> Now I want to shadow area labeled as "Power". Any suggestion
> how to do that using 'polygon' function?
>
> Thanks in advance for any suggestion.
>
> Andrej
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>

R-help_at_stat.math.ethz.ch 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. Received on Mon 25 Jun 2007 - 21:03:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Jun 2007 - 21:32:42 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.