As in the title, I have two sets of data that are identical. I performed a paired t-test using R.

The p-value for the difference estimated (which is essentially 0) is NaN.

I wonder if there can be a theoretical p-value for this case.

**Contents**hide

#### Best Answer

If the two sets of data are identical because the variables are defined on a discrete set of values, then the assumptions of the t-test are false, since the random variables aren't even continuous.

As such, any normal-theory calculation would not yield the correct p-values.

I think the "correct" t-test p-value would be NaN.

Alternatively, consider the degenerate case where continuous variables have finite variance but the differences have variance 0. Then the t-statistic would be 0/0; again I'd say that's "correctly" NaN. (edit: more details of that argument are in a comment)

However, if you (for example) assumed some

*discrete*distribution for the differences and derived say a likelihood ratio test, or did a permutation test, you'd get a (legitimate) p-value of 1, since anything but zero-differences would be "more extreme" than all-0-differences.

So I think justifiable p-values for a t-test will actually be what R gave you, while justifiable p-values if you have discrete variables and choose a more appropriate test would generally be 1.

### Similar Posts:

- Solved – the p-value for paired t-test if the two set of data are identical
- Solved – the p-value for paired t-test if the two set of data are identical
- Solved – Is the random variable discrete or continuous
- Solved – How should I treat F test if one of variances is equal 0
- Solved – Are two sets of 1-D data are equal, if they have same mean and variance and same size