Skip to content

Commit

Permalink
Use normal dist for ci if no degreess of freedom
Browse files Browse the repository at this point in the history
ci  - Confidence Intervals
  • Loading branch information
has2k1 committed Sep 10, 2019
1 parent ce7172b commit ebb2c3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plotnine/stats/smoothers.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ def tdist_ci(x, df, stderr, level):
Confidence Intervals using the t-distribution
"""
q = (1 + level)/2
delta = stats.t.ppf(q, df) * stderr
if df is None:
delta = stats.norm.ppf(q) * stderr
else:
delta = stats.t.ppf(q, df) * stderr
return x - delta, x + delta


Expand Down

0 comments on commit ebb2c3f

Please sign in to comment.