statsmodels/statsmodels — pull request #412 by phobson (2012-07-31 14:07:37+00:00)
Title: Q-Q plot with probabilities

In environmental engineering, bosses and regulators prefer to see probability plots over quantile plots since you can more easily pick out the likelihood of meeting (or exceeding) regulatory limit.

It was pretty simple to add this option to the qqplot function, so I simply expanded the existing test to cover it.

Here's an example plot:
```python
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
x = np.random.normal(4.0, 1.75, size=37)
fig, (ax1, ax2) = plt.subplots(nrows=2)
sm.qqplot(x, prob=False, ax=ax1)
sm.qqplot(x, prob=True, ax=ax2)
```
![QQPlot with probabilities](https://lh6.googleusercontent.com/-cRNHCw-PaGQ/UBfiCfypYjI/AAAAAAAABDo/S03wPcviLmU/s800/qqtest.png)

And a public gist: https://gist.github.com/3217134

At the moment, I'm just testing the waters with this PR. Ideally, I'd like to have 1 more option for the `prob` keyword beyond just `True` or `False`. Perhaps, `None,`'under', 'over'`.

- `None` would show the theoretical quantiles on the x-axis (existing functionality, top axis).
- `'under'` would create example like the link above (currently in this PR and lower axis).
- `'over'`, would flip the quantiles with `theoretical_quantiles` *= -1, making the x-axis display the likelihood of the sample set exceeding a given value (proposed).

There's certainly better choices for those options, but they escape me at the moment.

Thanks for any feedback and taking the time to look at this.