mqr.inference.confint.

ConfidenceInterval#

class mqr.inference.confint.ConfidenceInterval(name: str, method: str, value: float64, lower: float64, upper: float64, conf: float64, bounded: str)#

Result type for confidence interval calculations.

Attributes:
name: str

Statistic on which the confidence interval was calculated.

method: str

Statistical method for determining the interval.

value: float

Value of the bounded statistic.

lower: float

Lower limit of the interval.

upper: float

Upper limit of the interval.

conf: float

Confidence that determines the width of the interval.

bounded: {‘both’, ‘below’, ‘above’}

Which sides of the statistic are bounded by this interval.

Notes

The type is iterable, and iterates over the lower and upper bounds (in that order).

Examples

The results of confidence interval calculations will be return like this.

>>> import mqr
>>> ci = mqr.inference.confint.ConfidenceInterval(
>>>     'name', 'method',
>>>     value=1.0, lower=0.0, upper=2.0,
>>>     conf=0.98, bounded='both')
>>> print(ci)
ConfidenceInterval(
    name='test', method='method',
    value=1.0, lower=0.0, upper=2.0,
    conf=0.98, bounded='both')

Iterate over the lower and upper bounds:

>>> lower, upper = ci
>>> lower, upper
(0.0, 2.0)

When displayed in a jupyter notebook, this class is shown as an HTML table:

Confidence Interval
name
98% (fisher-z)

value

lower

upper

1.0

0.0

2.0