I am using scipy
in Python
and the following return a nan
value for whatever reason:
>>>stats.ttest_ind([1, 1], [1, 1])
Ttest_indResult(statistic=nan, pvalue=nan)
>>>stats.ttest_ind([1, 1], [1, 1, 1])
Ttest_indResult(statistic=nan, pvalue=nan).
But whenever I use samples that have different summary statistics, I actually get a reasonable value:
stats.ttest_ind([1, 1], [1, 1, 1, 2])
Ttest_indResult(statistic=-0.66666666666666663, pvalue=0.54146973927558495).
Is it reasonable to interpret a p-value of nan
as 0
instead? Is there any reason from statistics that it doesn't make sense to run a 2-sample t-test on samples with the same summary statistics?
nan
whenever I compare samples that have no variance. I was just wondering if it somehow makes no sense to do so from the point of view of statistics. I'll ask this question on StackOverflow, too. $\endgroup$