?qqplot ## note the "Value" section ?abline
z <- qqplot(datax,datay) abline(reg=lm(z$y ~ z$x)) As the help for abline says, you can fit any line you like, perhaps a simple resistant one would be better as in ?line, in which case use abline(reg= line(z$x, z$y)) ## note x's and y's are reversed from previous Cheers, Bert Gunter Nonclinical Biostatistics 467-7374 http://devo.gene.com/groups/devo/depts/ncb/home.shtml -----Original Message----- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Ralf B Sent: Thursday, June 24, 2010 2:45 PM To: r-help@r-project.org Subject: [R] Simple qqplot question I am a beginner in R, so please don't step on me if this is too simple. I have two data sets datax and datay for which I created a qqplot qqplot(datax,datay) but now I want a line that indicates the perfect match so that I can see how much the plot diverts from the ideal. This ideal however is not normal, so I think qqnorm and qqline cannot be applied. Perhaps you can help? Ralf ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.