In R you can run a paired t-test (e.g. t.test(x, y, paired=TRUE)) as well as a weighted t-test (e.g. wtd.t.test(x, y, weight=myVectorOfWeights)), but what about a weighted, paired t-test? t.test has no weights argument, wtd.t.test has no pairing argument, and I'm unable to find other alternatives. I have a dataset where I need to run such a test -- would appreciate it if anybody could point me in the right direction.
Asked
Active
Viewed 4,057 times
1
ncemami
- 113
- 1
- 3
1 Answers
5
A paired $t$-test is a one-sample $t$-test on differences. If you have two variables, such as before and after or right_side and left_side, you can compute the differences yourself easily (in R it would be: dif = after - before). Then you can run a one-sample $t$-test on those differences. Your null hypothesis is just that the mean of the differences is $0$.
gung - Reinstate Monica
- 145,122
wtd.t.test( x-y, weight=myVectorOfWeights)? – ncemami Apr 22 '16 at 00:42