26 Small sample size confidence intervals#

%%html
<iframe width="700" height="400" src="https://www.youtube.com/embed/K4KDLWENXm0/" frameborder="0" allowfullscreen></iframe>
import numpy as np
import pandas as pd
from pandas import Series, DataFrame
import matplotlib.pyplot as plt
import seaborn as sns
from scipy import stats, special

khanacademy

Small sample size confidence intervals fig 1Small sample size confidence intervals fig 2

x = np.array([1.5, 2.9, 0.9, 3.9, 3.2, 2.1, 1.9])
stats.t.interval(0.95, df=x.shape[0]-1, loc=x.mean(), scale=stats.sem(x))
(1.378978629330552, 3.306735656383734)