I made a plot of an empirical distribution function (EDF) using plot.ecdf(x, ...). In order to visualize normality, I'm looking in r for a qqline equivalent to draw a simple diagonal line in my plot. The normplot() function in MATLAB is doing the same thing (See the red line in the plot on this link: http://www.mathworks.de/de/help/stats/normplot.html). Thanks.
Asked
Active
Viewed 506 times
0
-
Please supply a reproducible example, or just have a look at `?abline`. – Josh O'Brien Feb 28 '13 at 17:57
-
`?qqnorm` and `?qqline` ? – liuminzhao Feb 28 '13 at 17:58
-
Do you want to compare your distribution with a normal dist, or with an idealized (i.e. model) version of your distribution? If the former, `qqnorm` ; if the latter `qqplot` . – Carl Witthoft Feb 28 '13 at 19:17
1 Answers
0
As mentioned in the comments, just call qqline()
:
x <- ecdf(rnorm(10))
plot.ecdf(x)
qqline(x)

Stedy
- 7,359
- 14
- 57
- 77