# Degree of Freedom twice as much as it should be?

I am performing paired t-test as following:

t.test(h1$pureinf_hvar, h1$pureinf_lvar, alternative="greater", Paired=T)

having each column of h1 (pureinf_hvar and pureinf_lvar) consisting of 43 observations each (43 subjects, data on 2 different treatments). Interestingly, the result shows a degree of freedom of 84 (or 83.925 due to Welch adjustment for the degrees of freedom).

I've performed some internet researches and found out that for 2-samples t-tests the df is typically defined as df = 2(n-1). However, for paired t-tests like mine there is just 1 group of subjects getting all treatments, so the df should be n-1, shouldn't it? Why does (Welsh-)t-test show a df of 84 (2*43-2) for paired samples intead of 42 (43-1) with my test?

• In R, capitalization matters; paired and Paired are not the same thing. Also, you should use TRUE rather than T because T is a variable, and it's easy for code to write over it. Imagine a session in which you (or some code you ran) has innocently used T to hold some information. Imagine T got set to 0. Now paired=T and paired=TRUE produce different results! In fact now the first thing actually says the same as paired=FALSE. That's too dangerous. Spell it out as TRUE (you can't accidentally overwrite TRUE). Being sure it's right is better than saving 3 characters. Jan 16, 2016 at 0:41
First, are you sure that you want to conduct Welch $t$-test? You used parameter Paired=T, so I assume that you wanted to conduct $t$-test for paired samples, however t.test in R does not have such parameter, it should be paired=T (lowercase), so it got ignored and you conducted $t$-test for independent samples.
As about Welch $t$-tests degrees of freedom, they are calculated differently, i.e. Welch–Satterthwaite equation is used. Check Wikipedia article on $t$-test, it described the different ways how df's are calculated for different kinds of $t$-tests. So if you conducted $t$-test for paired samples, than yes, degrees of freedom are calculated as $n - 1$, where $n$ is a number of pairs.