Answers for "how to get confidence interval of function python"

1

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)
Posted by: Guest on May-24-2021

Code answers related to "how to get confidence interval of function python"

Python Answers by Framework

Browse Popular Code Answers by Language