Skip to content

Plot 1:1 relationship

3 messages · Peter Francis, Sarah Goslee, Greg Snow

#
Dear list,

I am looking to plot a line on a graph to show the 1:1 relationship, in order to demonstrate the pattern i have observed is off the line, however i am unsure. I have tried abline but i can not see a function to plot the 1:1?


Any help would be greatly appreciated

#generate data
y <- rnorm(30, mean=1.5, sd= 0.005)
x <- rnorm(30, mean=1.5, sd= 0.005)
plot(x,y)

Thanks,

Peter
#
abline() takes the intercept and slope, which for a 1:1 relationship
are 0 and 1, respectively.
So:
abline(0, 1)

Sarah
On Fri, Jan 28, 2011 at 10:42 AM, Peter Francis <peterfrancis at me.com> wrote:

  
    
#
In addition you may want to include asp=1 and pty='s' to the plot command.