TWOSAMPLE TTEST
The twosample ttest is used to compare two different sample means. Similar to the onesample ttest, the hypothesis can
be either a onesided or twosided test. The tdistribution is required here because instead of population mean, two samples
are being compared. For the twosample ttest, the degrees of freedom are the number of observations for sample 1 (n_{1}) plus the number of observations for sample 2 (n_{2}) minus two. The formula for the twosample ttest is shown in the following equation:
in which mean_{1} and mean_{2} are the two means being compared, s_{1} and s_{2} are the standard deviation of each mean, and n_{1} and n_{2} are their respective sample sizes.
Table 2. An example of a onesided two sample ttest for purity. The hypothesis is that the new lot is not less pure than
the old lot (New ≥ Old).

If the value of t* is greater than the tabled value from the tdistribution, the two sample means are statistically different. An example of
a twosample ttest would be comparing the existing lot to a previous lot of material. Table 2 shows an example of a onesided
two sample ttest for purity. The hypothesis is that the new lot is not less pure than the old lot (New ≥ Old). The mean of
the new lot is statistically less pure than the mean of the old lot (p = 0.003). The t* of 3.49 exceeds the tabled value for a 95% confidence level with 10 degrees of freedom of 1.812. Notice that the tabled value
of a onesided 95% confidence level is the same as the twosided 90% confidence level.
ZTEST
The ztest is probably the most misused and misunderstood statistical test in biopharmaceutical organizations. The misconception
is that if the sample size is large enough (n > 30) then the ztest is appropriate. The ztest is restricted for only those
situations where the population variance is known. Because it is practically impossible to know the population variance and
computers can calculate the tdistribution for any sample size, it is preferred to use the ttest. If it is truly necessary
to use the ztest, the formula is:
in which Xmean is the sample mean, μ is the theoretical population mean, σ is the population standard deviation, and n
is the sample size used to estimate the mean.
Table 3. A comparison of the zvalues to the tvalues for sample sizes of 30, 60, and 120.

Notice that the formula for the ztest is similar to the formula for the onesample ttest. The only difference between the
two equations is the estimation of the standard deviation (square root of the variance). The ttest uses the sample standard
deviation and the ztest uses the population standard deviation. The normal distribution values do not require a sample size
because the standard deviation is known and, therefore, the tabled value is the same regardless of sample size. Table 3 shows
a comparison of the zvalues to the tvalues for sample sizes of 30, 60, and 120. The tdistribution, though close to the
normal distribution, does not converge to normal distribution until the sample size exceeds 120.
