SAS and T-Tests - Degrees of Freedom Why is it that in a normal t-test we have n-2 degrees of freedom while in the SAS output, and consequently the confidence interval constructed from this output, we end up using our 'error' degrees of freedom.  As an example say we have 1 DF for our linear model and 14 DF 'error'.  Then there are 15 DF in total.  However, we take t with 14 degrees of freedom = 15 - 1 rather than 15 - 2.  This is n-1 to my knowledge, not n-2.  Moreover, in a regular t-test we are taking n-2 since we have two degrees removed for b0 and b1 as parameters.  Why is the linear model only given 1 degree of freedom in SAS?
 A: If you have a one sample t-test, df = n-1. If you have a two sample t-test, df = n-2 (assuming equal variance)
In R:
set.seed(20283212)
x1 <- rnorm(100, 10, 5)
x2 <- rnorm(100, 10, 5)
t.test(x1, x2, var.equal = TRUE)
t.test(x1)

in SAS 
one sample (n = 5, df = 4)
data junk;
 input var1 var2 @@;
 datalines;
 1 2 4 -1 2 /*NOTE N = 5*/
run;

title 'Ons sample';
proc ttest data = junk;
 var  var1;
run;

Two samples (n = 14, df = 12):
data junk;
   input class $ var1 @@;
   datalines;
A 7  A 6  A 10  A 7  A 8  A 7  A 7
B 8  B 8  B 6  B 8  B 7  B 8  B 8
; /*note n = 14*/

title 'Two samples';
proc ttest data = junk;
 class class;
  var var1;
run;

A: First hint: show explicit examples of output (on the same data) for all your statements

Why is it that in a normal t-test we have n-2 degrees of freedom while in the SAS output, and consequently the confidence interval constructed from this output, we end up using our 'error' degrees of freedom. 

The $n-2$ in the two-sample $t$-test is the degrees of freedom for error. The sample has $n$ d.f. and you lose one for every estimated mean parameter (variance parameters aren't usually counted in this for linear models); you have two samples, and estimate two means (or the overall mean and the difference in means, or the first mean and the difference in means), losing 2 d.f.

As an example say we have 1 DF for our linear model and 14 DF 'error'

The intercept costs you a d.f. (which is normally why the d.f. count starts from n-1) and you lose one for each predictor after that.

Then there are 15 DF in total. 

Well, the "total" d.f. (the error d.f. that goes with the intercept-only model) might be 15 if there are 16 observations (and 16 d.f.) and you subtract one for the intercept.

However, we take t with 14 degrees of freedom = 15 - 1 rather than 15 - 2. 

 14 = 16 - 2 

for a two sample $t$.

Why is the linear model only given 1 degree of freedom in SAS?

because it subtracted 1 for the intercept right at the start, which is why the total d.f. is only 15 and not 16.
