Blogger

Delete comment from: One R Tip A Day

Anonymous said...

Hello. This is great R code but I cannot use the above code because I transform data (please see below). Is there any way to highlight overlapping area between two curves?

... such like
a1=-0.116977231
b1=0.776585015
c1=0.116977231
d1=0.065499503

y1=rnorm(1000000,0,1)
y1=a1+b1*y1+c1*y1^2+d1*y1^3
y2=rnorm(1000000,0,1)
y2=a1+b1*y2+c1*y2^2+d1*y2^3
y2=2.5*y2+0.5

plot(density(y1), xlim= c(-7, 7), ylim =c(0, 0.75), col="black", lwd=2, lty=1, xlab=" ", main="",bty="l" )
lines(density(y2), xlim= c(-7, 7), ylim =c(0, 0.75), col="black", lwd=2, lty=2, xlab=" ", main="")

Many thanks..

Yoonjeong

Aug 6, 2013, 6:35:34 AM


Posted to Highlight overlapping area between two curves

Google apps
Main menu