Data analysis Part 8: Two sample t test with unequal variances
Data analysis Part 8: Two sample t test with unequal variances (Welch’s t-test)
Two sample t test is done to decide if the population mean of two batches of samples are is equal or not.
Population mean of two batches of samples are equal or not?
To perform two sample t test with unequal variances, first F test is carried out to find out whether the variances of the two samples are equal or not.
Let us take two sets of data as follows (Actual weight of paracetamol tablets that are marketed as 500mg)
Batch1 | Batch2 |
---|---|
499.643 | 500.240 |
499.475 | 501.055 |
500.459 | 500.120 |
499.692 | 500.680 |
497.946 | 500.478 |
500.280 | 500.157 |
500.072 | 499.961 |
500.054 | 500.833 |
499.619 | 501.052 |
500.761 | 499.996 |
499.251 | 499.264 |
500.808 | 499.221 |
500.224 | 500.384 |
500.083 | 500.999 |
500.747 | 499.507 |
498.547 | 500.690 |
501.282 | 499.731 |
499.672 | 499.934 |
499.086 | 497.957 |
499.600 | 499.131 |
500.828 | 499.257 |
501.772 | 502.237 |
499.615 | 498.184 |
500.491 | 500.381 |
499.105 | 501.112 |
Result of F test suggest that the variances of the two batch of samples are not equal.
t-Test: Two-Sample Assuming Unequal Variances
Batch 1 | Batch 2 | |
---|---|---|
Mean | 499.965 | 500.102 |
Variance | 0.725 | 0.904 |
Observations | 25 | 25 |
Hypothesized Mean Difference | 0 | |
df | 47 | |
t Stat | -0.540 | |
P(T<=t) one-tail | 0.296 | |
t Critical one-tail | 1.678 | |
P(T<=t) two-tail | 0.592 | |
t Critical two-tail | 2.012 |
Two tailed vs one tailed t test
Here we are open to the two types of outcomes i.e. printed weight is less or more than the actual weight. Hence, two tailed t test is applicable.
If we want to know whether the printer weight is more than the actual weight or not, in that scenario one tailed t test has to be used. For two tailed test α = 0.05. For one tailed test α = 0.025.
Result and discussion
As per Fig.1 (Two sample two tailed t-test), it can be seen that test statistic (t Static) falls within the specified critical value (t critical).
- Acceptance of Null hypothesis means wt. of paracetamol tablet (population mean) from two batches are equal. (Batch 1 = Batch 2).
- Rejection of Null hypothesis/ acceptance of alternative hypothesis means wt. of paracetamol tablet (population mean) from two batches are different. (Batch 1 ≠ Batch 2).
In this case as per Fig.1., Null hypothesis is accepted. Hence it is conclusively proved that there is no difference between the weight of batch 1 and batch 2 and mean weight of batch 1 and 2 matches with each other.
Population mean of batch 1 = batch 2 (Statistically proven without individual's bias)
Reference
Hyperlinked in the text.
Comments
Post a Comment