Paired t-tests can be used for quantitative variables that share a common characteristic. This article will show you how to create a 95% confidence interval for a “before and after” paired t-test as well as how to analyze the null and alternate hypotheses.

For my paired t-test, the question at hand will be, “is the mean difference in weight for anorexic girls more after cognitive therapy than before cognitive therapy?”

In this example, I will be using a dataset dealing with the before and after weights (kg) of anorexic girls. The first weights will be measured without the interference of “cognitive therapy,” and the second weights will be measured with the involvement of “cognitive therapy.”

**Summary Results of the Data**

On my Excel spreadsheet, I had two columns of data. The first column consisted of weights “before” cognitive therapy and the second column was of weights “after” cognitive therapy. Using Excel’s function bar, I subtracted column “A” from column “B” to get a third column of the difference between the weights.

I then analyzed this column of weight differences using the data analysis function, “descriptive statistics.”

My parameter of interest, the mean of the difference in weights (d-bar), equaled -3.0069 (rounding up to four decimal places). The sample size that I am using is 29 girls.My standard error for the data was 1.3572 (rounding up to four decimal places). My standard deviation equaled 7.3085 (rounding up to three decimal places.) Since this is a paired t-test dealing with means, we will be using the test statistic “t.”

**Assumptions**

Before running the paired t-test, it is essential to check your sample to either have a bell-shaped curve or to be greater than 30. Because my sample size is less than thirty, I will need to create a graph to verify that the data has a normal, bell-shaped curve. To check the shape of the data, you can create a histogram, a stem and leaf plot, or a dot plot. I chose to create a histogram and I saw that the data did form a bell-shaped curve. If your sample size is greater than 30, then it’s unnecessary to check the shape of your data.

I almost have enough information to create the 95% confidence interval for my data. I have my sample mean (d-bar), my standard deviation (sd), and my standard error (s.e.). All I need now is my “t” statistic. To calculate “t,” I went into Microsoft Excel and clicked on the “TINV” function. I put in .05 for a 95% probability and I entered the degrees of freedom, 28 (sample size -1). In return, I got my “t” statistic to be 2.04841.

To calculate my 95% confidence interval, I will follow this formula:

d-bar +/- t(s.e.)

I multiplied my “t” statistic to my standard error and then I subtracted that number from the mean for one value, and then I added that number to the mean for my other value. Here is the result of my calculation:

= -3.0069 +/- 2.0484(1.3572)

= -3.0069 +/- 2.7801

= -5.787 and -0.2268

Using these values, I am 95% confident that the true mean difference in weights of anorexic girls before and after cognitive therapy can be captured in the interval of -5.787 to -0.2268.

**Hypotheses**

H0: ud = 0 kg (there is no difference in the mean weights of anorexic girls before and after cognitive therapy).

H1: ud

My calculated t-statistic is -2.2155. This is calculated by subtracting the null value, 0, from the sample mean (d-bar), -3.0069. I then divided this number by the standard error (s.e.), 1.3572.

My p-value equalled 0.017515. To calculate the p-value using a t-statistic, use the function “TDIST” in Excel. Enter the t-statistic in the “X” field and put in the degrees of freedom, 28 (n-1). Since this is a one-tailed test, enter a “1” in the last field. Hit return and your p-value will pop up in a blank cell.

**Decision**

Since my p-value is 0.017515, I will reject the null hypothesis and conclude that there is sufficient evidence to support the claims of H1.

**Conclusion**

My paired t-test resulted in a low enough p-value and therefore I will conclude that there is enough evidence to say that the mean difference in weight for anorexic girls is more after cognitive therapy than before the therapy.