# 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:

1. Is there a way to do a paired samples t-test in statsmodels that I'm missing?
2. Is there a way to use ttost_paired to do what I want?
3. 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 paired sample t-test is just a one sample t-test on the difference of the two samples, i.e. t_test(x1 - x2, ...). Oct 10 '18 at 0:49

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.

Standard paired t-test for two samples y1 and y2 is just the one sample t-test applied on the difference d = y1 - y2.