Would this work?

m1 <- 3.5
m2 <- 6.5
s1 <- 0.8
s2 <- 0.8
dist1 <- dnorm(x, mean=m1, sd=s1)
dist2 <- dnorm(x, mean=m2, sd=s2)
biModalDist <- dist1 + dist2

q <- qnorm(.9,0,1)
z1 <- q*s1
z2 <- q*s2
zLow <- m1 - z1
zUp <- m2 + z

xShade <- seq(zLow, zUp, 0.1)
d1Shade <- dnorm(xShade, mean=m1, sd=s1)
d2Shade <- dnorm(xShade, mean=m2, sd=s1)
yShade <- d1Shade + d2Shade

windows()
plot(x, biModalDist, type="l")
polygon(x=c(zUp, zLow, xShade), y=c(0,0,yShade), col="gray")


On 1/15/2012 2:41 PM, AbouEl-Makarim Aboueissa wrote:
Dear R users:

I am currently teaching a course in Statistics. Can someone give an R code(s) 
to create a biomodal curve(s) with shaded area of 90% and with 5% in each tail

With many thanks
abou



==========================
AbouEl-Makarim Aboueissa, Ph.D.
Associate Professor of Statistics
Graduate Program Coordinator
Department of Mathematics&  Statistics
University of Southern Maine
96 Falmouth Street
P.O. Box 9300
Portland, ME 04104-9300
USA


Tel: (207) 228-8389
Fax: (207) 780-5607
Email: [email protected]
           [email protected]

Office: 301C Payson Smith


        [[alternative HTML version deleted]]

_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching

-----
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.1901 / Virus Database: 2109/4744 - Release Date: 01/15/12



_______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-teaching

Reply via email to