[R] Simple qqplot question

Bert Gunter gunter.berton at gene.com
Fri Jun 25 00:56:37 CEST 2010


?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-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On
Behalf Of Ralf B
Sent: Thursday, June 24, 2010 2:45 PM
To: r-help at 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 at 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.



More information about the R-help mailing list