bundles / scipy latest / scipy / stats / _stats_py / QuantileTestResult / confidence_interval
function
scipy.stats._stats_py:QuantileTestResult.confidence_interval
source: /scipy/stats/_stats_py.py :8957
Signature
def confidence_interval ( self , confidence_level = 0.95 ) Summary
Compute the confidence interval of the quantile.
Parameters
confidence_level: float, default: 0.95Confidence level for the computed confidence interval of the quantile. Default is 0.95.
Returns
ci: ``ConfidenceInterval`` objectThe object has attributes
lowandhighthat hold the lower and upper bounds of the confidence interval.
Examples
import numpy as np import scipy.stats as stats p = 0.75 # quantile of interest q = 0 # hypothesized value of the quantile x = np.exp(np.arange(0, 1.01, 0.01)) res = stats.quantile_test(x, q=q, p=p, alternative='less') lb, ub = res.confidence_interval()✓
lb, ub
✗res = stats.quantile_test(x, q=q, p=p, alternative='two-sided') lb, ub = res.confidence_interval(0.9)✓
lb, ub
✗Aliases
-
scipy.stats._stats_py.QuantileTestResult.confidence_interval