Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

confidence intervals in python

import numpy as np
import scipy.stats as st

#define sample data
data = [12, 12, 13, 13, 15, 16, 17, 22, 23, 25, 26, 27, 28, 28, 29]

#create 95% confidence interval for population mean weight
st.t.interval(alpha=0.95, df=len(data)-1, loc=np.mean(data), scale=st.sem(data)) 

(16.758, 24.042)
Source by www.statology.org #
 
PREVIOUS NEXT
Tagged: #confidence #intervals #python
ADD COMMENT
Topic
Name
9+8 =