In the following code, the only difference between the two plots is the 
order the variables are plotted.  In this case, the plot of "cdata.den" in 
plot #1 is different from its plot in #2. Specifically, "cdata.den" spans 
the x-axis from -5 to 30 in plot #1 and from 0 to 20 in plot #2. Does 
anyone understand why these two plots do not yield the same result? 

#Make density objects
pre.den<- density(
        preclaims[preclaims[,7]>cc1 & preclaims[,7]<cc2,7],
        from = cc1,
        to = cc2)
cdata.den<-density(cdata,from=cc1,to=cc2)

#Plot No. 1
x11()
plot(cdata.den,col=1)
lines(pre.den,col=2)

#Plot No. 2
plot(pre.den,col=2)
lines(cdata.den,col = 1)

 Regards,
 
Stephen Collins, MPP | Analyst
Health & Benefits | Aon Consulting
200 East Randolph, Suite 900, Chicago, IL
Tel: 312-381-2578 | Fax: 312-381-0136
Email: stephen_collins@aon.com
 

	[[alternative HTML version deleted]]

