I'd like to do a simple scatter plot but instead of using the variable values on the X axis I would like to plot the percentiles. I searched in the manual for percentiles but did not find what I was looking for. I've been using SAS for several years but I new to R. -- Dean Sonneborn Programmer Analyst Department of Public Health Sciences University of California, Davis (916) 734-6656
I'm doing this scatter plot and it's almost what I want. What I would like to change is to have the X axis (the lipid_adj_pcb_cent variable) be plotted in percentiles not the variable values. Here's the code I currently using: xyplot(zawgt_sk_cent ~ lipid_adj_pcb_cent, panel=function(x,y){ panel.xyplot(x,y) panel.lmline(x,y)}, auto.key=TRUE, data=centered, na.strings="", fontfamily = "HersheySans" , scales = list( tick.number = 10)) -- Dean Sonneborn Programmer Analyst Department of Public Health Sciences University of California, Davis (916) 734-6656 [[alternative HTML version deleted]]
Here is a hack par(mfrow=c(1,2)) x <- rnorm(1000) y <- x + rnorm(1000) xp <- (rank(x)-1)/(length(x)-1) plot( x, y ) plot( xp, y ) But do notice that by using percentiles, it spreads the 'x' values evenly. This may be important for points at the extremes. Regards, Adai On Thu, 2005-08-11 at 15:40 -0700, Dean Sonneborn wrote:> I'd like to do a simple scatter plot but instead of using the variable > values on the X axis I would like to plot the percentiles. I searched in > the manual for percentiles but did not find what I was looking for. I've > been using SAS for several years but I new to R. >