All problems
Paired Differences t Statistic
Problem
For paired data, t = mean(d) / (s_d / sqrt(n)) where s_d is the sample standard deviation of the differences with n - 1 in the denominator.
Given the differences, return t. Assume n >= 2.
Hint
Treat the paired differences as a single one-sample problem.
Test cases
case 1
in: [[1,2,3]]
expected: 3.464101615137755
case 2
in: [[1,-1,1,-1]]
expected: 0
case 3
in: [[0.5,1,1.5]]
expected: 3.464101615137755
Starter codePython
def paired_differences_t_statistic(differences):
# Your code here
pass3 test cases · run your code against them in the editor