0
$\begingroup$

I have two dfs:

df1       and df2 
1              3
2              3
2              4
4              6
6              7
7              
9              

I want to calculate Two-sample PAIRED t-test but I am unable to coz both the dfs don't have the same length.

I am using the t, p = stat.ttest_rel(df1, df2) method from scipy to calculate.

Any help will be greatly appreciated.

$\endgroup$
1
  • $\begingroup$ Why do you want to do a paired test? $\endgroup$
    – Dave
    Jul 18 at 12:55
2
$\begingroup$

You cannot. You either remove the pair(s) where one value is missing (which might introduce bias - especially in this case where only the high values in df1 are missing their pairs in df2) or you impute them (e.g., by using multiple imputation).

$\endgroup$
1
  • $\begingroup$ I agree with the answer in general (+1) but imho doing a significance test based on imputed values has little value. $\endgroup$
    – Erwan
    Jul 18 at 11:49
0
$\begingroup$

A paired t-test does not make much sense unless you have unequal numbers of observations. How about performing a regular t-test?

$\endgroup$
1
  • $\begingroup$ I do have unequal number of observations. The first df has 7 while the second has only 5. $\endgroup$ Jul 18 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.