From Genome Analysis Wiki
Jump to navigationJump to search
66 bytes added
, 17:34, 3 November 2011
Line 20: |
Line 20: |
| ); | | ); |
| </syntaxhighlight> | | </syntaxhighlight> |
| + | |
| + | == A Fancier QQ Plot by Matthew Flickinger == |
| | | |
| Unfortunately the simple way of doing it leaves out many of the things that are nice to have on the plot such as a reference line and a confidence interval plus if your data set is large it plots a lot of points that aren't very interesting in the lower left. Here is a more complex example that adds a few more niceties and thins the data to only plot meaningful points | | Unfortunately the simple way of doing it leaves out many of the things that are nice to have on the plot such as a reference line and a confidence interval plus if your data set is large it plots a lot of points that aren't very interesting in the lower left. Here is a more complex example that adds a few more niceties and thins the data to only plot meaningful points |
Line 133: |
Line 135: |
| } | | } |
| </syntaxhighlight> | | </syntaxhighlight> |
| + | |
| + | === Sample Usage === |
| | | |
| A sample call to this function would be | | A sample call to this function would be |
| + | |
| <syntaxhighlight lang="rsplus"> | | <syntaxhighlight lang="rsplus"> |
| qqunif.plot(my.pvalues) #these are the raw p-values, not log-transformed | | qqunif.plot(my.pvalues) #these are the raw p-values, not log-transformed |
| </syntaxhighlight> | | </syntaxhighlight> |
| | | |
− | The confidence intervals are calculated using the fact that the standard uniform order statistics follow a beta distribution. The default settings will draw confidence intervals around the 1000 more significant points. You can change that with the <code>conf.points=</code> parameter and you can change the alpha level from the default .05 using the <tt>conf.alpha=</tt> parameter. If you wish to disable the confidence interval, use <tt>draw.conf=F</tt> in your call to <tt>qqunif.plot()</tt>. | + | The confidence intervals are calculated using the fact that the standard uniform order statistics follow a beta distribution. The default settings will draw confidence intervals around the 1000 more significant points. You can change that with the <tt>conf.points=</tt> parameter and you can change the alpha level from the default .05 using the <tt>conf.alpha=</tt> parameter. If you wish to disable the confidence interval, use <tt>draw.conf=F</tt> in your call to <tt>qqunif.plot()</tt>. |
| | | |
| This function does thin the data by rounding the observer and expected -log10 p-values to two places by default. You can control the thinning with the <tt>should.thin=</tt>, <tt>thin.obs.places=</tt>, and <tt>thin.exp.places=</tt> parameters. | | This function does thin the data by rounding the observer and expected -log10 p-values to two places by default. You can control the thinning with the <tt>should.thin=</tt>, <tt>thin.obs.places=</tt>, and <tt>thin.exp.places=</tt> parameters. |