I would like to do draw 95% confidence interval in python
using statsmodels
, but qqplot()
doesn't have this option.
If it's not possible, math equation is also acceptable so that I can simply add it to the plot on my own.
import numpy as np
import statsmodels.api as sm
import matplotlib.pyplot as plt
data = np.random.normal(5, 10, 100)
fig = sm.ProbPlot(data, fit=True).qqplot()
plt.show()
There is an implementation in R
that I found on the internet, but I am not familiar with R
...
The pingouin
package has a function to create a qqplot with confidence interval lines. This would do the trick:
import numpy as np
import pingouin as pg
data = np.random.normal(5, 10, 100)
ax = pg.qqplot(data, dist='norm', confidence=.95)