In earlier blogs we discussed about two sample z test,t test with equal and unequal variance.

Today we will talk about two sample paired t test and two sample p test.

Paired t Test:

  • Two samples in which observations in one sample can be paired with observations in other sample.
  • The samples are dependent, means values in one sample affect the other sample.
  • Example: Blood sample before and after some medication.

Below is the formula to calulate the paired t test:

paired t test

Where d1, d2, d3..dn are difference of two sample and find the mean and standard deviation of these differences.

Let’s solve one problem to get clear understanding of paired t test:

Problem: BP is measured for few patients before and after some medication. Are there any difference at 95% confidence level?

Patient NameBefore MedicationAfter Medication

Null Hypothesis: Mean of sample before medication = Mean of sample after medication
Alternate Hypothesis: Mean of sample before medication not equal to the mean of sample after medication.

Patient NameBefore MedicationAfter Medicationdifferences
Harry110108 2
Jason145140 5
Bob130128 2
Andrew140140 0

d-bar= mean of differences=1.6
standard deviation(s)=2.3

Put all the values in paired t Test formula
t calculated=1.6
t critical=2.766

t calculated < t critical meaning failed to reject the null hypothesis.
There is no significant difference in BP after specific medication.

Two sample p Test: Here we calculate the proportion and find the z statistics. If z calculated is gerater than z critical value, can reject the null hypothesis otherwise failed to reject the null hypothesis.

Nomal approximation- pooled
Normal approximation- Unpooled

Let’s try to understand the concept solving one of the practical problem.

Problem: In a factory, we picked 100 samples that are produced by machine A in which 10 are defective. We also picked other 200 samples that are produced by machine B in which 30 are defective. Is there any significant difference between two machines at 95% confidence level?

Solution :

Machine AMachine BPooled
Total Items100200300
Percentage defective0.10.150.13


When we keep these values in the pooled formula mentioned above :

z calculated=1.2

z critical for 95% confidence level =1.96
z calculated < z critical

It means that we failed to reject the null hypothesis.
we can say that there is no significant difference between machine A and machine B.


Leave a Reply

Your email address will not be published. Required fields are marked *

Insert math as
Additional settings
Formula color
Text color
Type math using LaTeX
Nothing to preview