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:

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?

Solution:
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.

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

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.

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 :

p1-bar=0.1
p2-bar=0.15
p-bar=0.13
n1=100
n2=200

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.

$${}$$