0

I'm wondering if there is a way to perform a two-tailed t-test for an estimate, given its standard error and the number of degrees of freedom? The estimate is read from another software. I have been using the t.dist.2t(abs(estimate/SE), df) in Excel, but having it directly in Python would be a huge help....

branwen85
  • 1,606
  • 5
  • 20
  • 25
  • Pandas should have everything you're looking for. Also https://pypi.python.org/pypi/pyvttbl would help with creating anova tables – itzmurd4 Jun 22 '17 at 13:41
  • Pandas? Do you have an example? The only ones I found were actually using scipy.stats on a panda dataframe. That doesn't help me at all, as I don't have the data on which the estimate was calculated. – branwen85 Jun 22 '17 at 13:48

1 Answers1

1

Just in case anyone is looking for a solution, I have been provided with one by my colleague

import scipy.stats as stats
import numpy as np

est=0.0044
se=0.0826
df=767

pval = stats.t.sf(np.abs(est/se),df)*2
branwen85
  • 1,606
  • 5
  • 20
  • 25