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?
|Patient Name||Before Medication||After 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 Name||Before Medication||After Medication||differences|
d-bar= mean of differences=1.6
Put all the values in paired t Test formula
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?
|Machine A||Machine B||Pooled|
When we keep these values in the pooled formula mentioned above :
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.