Sunday, 4 March 2018

Hypothesis Testing - How to Perform Paired-Sample t-Test

What is paired-sample t-test?
This is also called two-sample t-test or dependent samples t-test.
This is a test used to compare the means of two populations. Here two samples are provided where corresponding measurements from the two sample could form pairs.This means that the number of measurements from the two samples would be the same.

That is n1 = n2

Scenario where it can be applied
Some of the scenarios where paired t-test could e applied include:
Before-and-after osbservations with the same subject. Examples could be weights of respondents before and and after a weight-loss therapy, test scores of student after taking an intensive prep etc
Another scenario wuold be comparing two different methods of measurement on the same subjects. Example would be comparing the effect of treatment with injection with treatment with tablets on the same group of patients.


How to Carry out Paired-Sample t-Test (Step-by-Step Procedure)
Assuming a sample of n students  were underwent a two-weeks tutorial towards the end of the semester. During this tutorials, past questions and answers were discussed and solved. We want to know how effective the two-weeks tutoria was.
So a test was given to the students before the tutorial and their scores are recorded. After the tutorial, a test was also given to the same set of studend and the scores were recored.
In this case paired sample t-test will help us achieve this objective

Let:
x = test scores of the students before the tutorial
y = scores of the students after taking the tutorial


Step 1: Set up the null and alternate hypothesis

Step 2: Tabulate the given values with colums for differnce as shown below
Normally you can use a spreadsheet like excel to to this

Watch a video on how to do this.

Step 3: Calculate the mean difference
To do this, you need to first subtract  the correnponding values for each pair. Then you find the mean of this new column D

Step 4: Calculate the standard deviation of the differences
To to this, you need to subtract the mean differenct for each value of D. That would give you the 5th column of the table. Watch the video to get it clearer.
The formular for the standard deviation is:
Remember you need to take square root, to get the standard deviation

Step 5: Calculate the Standard Error
This is given by the formula



Step 5: Calculate the t statistic
The t statistic can be calculated using the formula. That is, the mean difference divided by the standard error value.


Step 6: Look up the t value from table of t-distibution
To to this, you need to know:
the degree of freedom df, given by n-1
where n is the number of samples
Also the significance leve, which is normally given. Most times it it 0.05

Step 7: Compare the tabulated t and calculated t
If the calculated value of t is greater than the tabulated value, this means that there is significant difference between the two means. But if the calculated value of t is less than the tabulated value, this means that there is no significant difference between the two.

Step 8: State your conclustion 
 Your conclusion would be based on the set up of your null and alternate hypothesis. You can either state that: 'based on the.... we therefore conclude that the tutorials does not have any effect on students performance' or ' we therefore conclude that the tutorials leads to a significant improvence in the performance of students on the test'

Sample Question Solved here

Watch a video on how to use excel to generate mean, Sd and difference.