mcframework.utils.t_crit#

mcframework.utils.t_crit(confidence: float, df: int) float[source]#

Two-sided Student t critical value \(t_{\alpha/2,\;\mathrm{df}}\).

Parameters:
confidencefloat

Confidence level in (0, 1).

dfint

Degrees of freedom (\mathrm{df} \ge 1), typically n-1.

Returns:
float

\(t_{\alpha/2,\;\mathrm{df}}\ \)- the upper \(1-\alpha/2\) quantile of \(t_{\mathrm{df}}\).

Raises:
ValueError

If confidence is not in (0, 1) or df < 1.

Examples

>>> round(t_crit(0.95, df=9), 3)
2.262