Skip to content

Commit

Permalink
Added function to make QQ-plot
Browse files Browse the repository at this point in the history
  • Loading branch information
lorinanthony committed Aug 2, 2016
1 parent 78b55bf commit c266959
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions QQPlot.R
@@ -0,0 +1,9 @@
ggd.qqplot = function(pvector, main=NULL, ...){
o = -log10(sort(pvector,decreasing=F))
e = -log10( 1:length(o)/length(o) )
plot(e,o,pch=19,cex=1, main=main, ...,
xlab=expression(Expected~~-log[10](italic(p))),
ylab=expression(Observed~~-log[10](italic(p))),
xlim=c(0,max(e)), ylim=c(0,max(o)))
lines(e,e,col="red")
}

0 comments on commit c266959

Please sign in to comment.