Solved – Formula confidence interval for difference in means – one sample t-test

confidence intervalmeant-test

I am looking for the formula of the confidence interval for the difference between means in a one sample t-test. I have only been able to locate the formula for a two sample t-test.

Let me give an example: I have the following ten scores

10,12,13,11.5,9,11,11.1,11.9,12.1,9.3

I want to know if the mean of these scores is significantly different from my population mean of 11.5. When I conduct a one sample t-test in SPSS I get the following results:

t obtained = -10.776   
SIG (i.e., P) = 0.000  
95% CI of the difference = -5.3363 to -3.4837.   

I know how SPSS calculated t and P but not how it calculated the 95% CI of the difference. This 95% CI of the difference is not the same as the CI for the mean. The CI for the mean I can obtain by

$$CI =\bar{x} \pm t S/\sqrt{N}.$$

The confidence interval in this case is: 10.16,12.01. I get the same result if I calculate this in SPSS.

So my question is: what is the formula for the CI of the difference which SPSS produces? How do I get that range? I do not want the CI for the mean. Thanks.

Best Answer

The confidence interval provided by the OP (10.16, 12.01) is correct for the data provided. The SPSS output does not match this data, whether or not the population mean is subtracted. (t value incorrect, CI incorrect, p-value incorrect.) The output is either from a different example or there was some error in what data was passed to the function.

In R:

A = c(10, 12, 13, 11.5, 9, 11, 11.1, 11.9, 12.1, 9.3)

B = A - 11.5

t.test(A, mu=11.5)

   ### One Sample t-test
   ### data:  A
   ### t = -1.0013, df = 9, p-value = 0.3428
   ### alternative hypothesis: true mean is not equal to 11.5
   ### 95 percent confidence interval:
   ### 10.16374 12.01626
   ### sample estimates:
   ### mean of x 
   ###     11.09

t.test(B, mu=0)

   ### One Sample t-test
   ### data:  B
   ### t = -1.0013, df = 9, p-value = 0.3428
   ### alternative hypothesis: true mean is not equal to 0
   ### 95 percent confidence interval:
   ### -1.3362575  0.5162575
   ### sample estimates:
   ### mean of x 
   ###     -0.41