title: calculate a confidence interval from the outputs of stats.linregress in python
body: <p>I have a data set with two variables and I have calculated the type 1 linear regression line. I used the stats.linregress and got these results:
  LinregressResult(slope=0.06310526340834267, intercept=0.4327958012533457, rvalue=0.9873212197443118, pvalue=0.0, stderr=0.0003365099759072618)</p>
  
  <p>Now, I need to create a function called slope_ci that calculates confidence intervals for the slope of the regression line, given the data values and confidence level (default 95%).
  I am having trouble figuring out if I have to create a function that finds the critical t value to use for this confidence interval and how I would go about that?</p>