Paired samples t test in Python I'm trying to conduct a paired samples t-test in Python (statsmodels package), but I don't see a function for it in their documentation. The closest I can find is ttost_paired, but I don't think its correct as their null hypothesis is that the mean difference is > or < some boundary value, whereas for my desired test the null is x1 - x2 = 0
A few questions:


*

*Is there a way to do a paired samples t-test in statsmodels that I'm missing?

*Is there a way to use ttost_paired to do what I want?

*They do also have an independent samples ttest. What could go wrong if I use an independent ttest on paired data?


I know I can do a paired t-test using scipy but I'm wondering specifically about statsmodels
 A: the function ttost is not a t-test and therefore is not suitable for your purposes. 
The TTOST is a test of non-equivalence. It employes two one-sided t-tests in order to verify if both samples are equivalent or not. Please, have a look at the function documentation.
There exists the ttest_mean function on the statsmodels package. However, it does not indicate if the test is conducted with paired samples or not. Thus, I recommend you to use the scipy.stats t-test.
And about your last question:

They do also have an independent samples ttest. What could go wrong if I use an independent ttest on paired data?

The paired t-test reduces intersubject variability. Thus, it is theoretically more powerful than the unpaired t-test.
A: You can use the ttest_rel function in scipy.stats:

Calculate the t-test on TWO RELATED samples of scores, a and b. This
  is a two-sided test for the null hypothesis that 2 related or repeated
  samples have identical average (expected) values.

A: Standard paired t-test for two samples y1 and y2 is just the one sample t-test applied on the difference d = y1 - y2.
The same applies when using a normal distribution in a z-test.
(That and the availability of paired t-test in scipy.stats are the reasons why statsmodels currently does not implement a separate paired t-test.)
