Part III: One & Two Sample Parametric Tests
Two Sample t and z Tests

 
 
Two sample tests are what we call tests of independence rather than goodness of fit tests. We are testing to see whether or not 2 variables are "related" or "dependent". Thus, the Ho takes the general form Ho: x and y are independent. With the 2 sample t and z, the x variable is nominal scale of measurement and dichotomous (takes on only 1 of 2 possible values). The y variable is treated as continuous (can take on a whole range of values on a continuum). For example, 2 groups each receive a different teaching method, and their final exam scores are compared.

x = 1 teaching method A (group #1), 2 teaching method B (group #2)
y = final exam score (dependent variable)

Ho: x and y are independent.

There is an important distinction to be made here. Sometimes people make the mistake of thinking that since there are 2 groups and 2 variables, group 1 must be x and group 2 must be y. This is incorrect, not to mention impossible. Instead, note that the independent variable, x has 2 levels (i.e. it is dichotomous). So the 2 groups are the 2 levels of the independent variable x. They are the 2 values that x can take on. We say then that the variable x refers to group membership. In addition to being placed in a group, all the subjects are measured on a second variable y, that is interval (in our case, exam scores).

The logic is this: if the 2 groups (x1 and x2) do not differ in average exam scores (y), then we conclude that there is no relationship between group membership (teaching method) and final exam scores (i.e. no relationship between x and y). Just as in probability, we would say that knowing the value of x (x1 or x2) gives us no information on y (since y is no different for x1 or x2. In other words, the mean score on y in the population for group 1 does not differ from the mean score on y in group 2. (Note that this is the same as saying the the difference between them is zero!)

 
 
We now want to test the null hypothesis set above. The general form of the formula is the same as for the one sample z test: z equals the difference of the test statistic (the mean) and the null hypothesis value divided by the standard deviation of the statistic.

In the case of two samples, we simply subtract the means (and divide by the standard error of the difference between means) to obtain the test statistic. Below is the full z formula:

Picture (492x65, 2.1Kb)

Note how the z formula simplifies when m1 - m2 = 0 (as it does in most cases). Again, if the population standard deviations are unknown, but N is sufficiently large, you can still use this formula by substituting the sample standard deviations for the population standard deviations.

 
 
Again, we're testing the null hypothesis set above. The formula for the one sample t test even closely matches our formula for the one sample z test. And once again, note how the formula reduces when there is no expected difference between the two population means:

Picture (407x88, 2.3Kb)

Here, the standard error of the difference between means can be calculated directly from the data. (note the n - 1 in the denominator; this formula provides the unibiased estiamte we are looking for!)

Picture (530x64, 2.5Kb)

When the sample sizes are equal, the formula for the standard error simplifies somewhat:

Picture (143x54, 1.3Kb)

 
 
When testing for a relationship between two variables, sometimes there is a 3rd variable, which we are not interested in at the moment, which influences our results. In our previous example, suppose that final exam scores are also influenced by an individuals' IQ (not just teaching method). If we only want to focus on the influence of teaching method on y, we need to control for individual differences on IQ. The matched tdf test is the statistic for doing this. There are two possible ways to do it.
  • Two groups matched on some third variable, i.e. IQ
  • Take repeated measures of the same subjects (Give all subjects both teaching methods and measure exam scores twice). Here, subjects are matched on all variables, not just IQ.

So, the null hypothesis (Ho: x and y are independent), can also be written as:

Ho: mD = 0, where mD = population mean of difference scores
df = N - 1, where N = the number of pairs of participants

Then, using the standard "template" for our inference test, we have:

Picture (472x85, 2.9Kb)

 
 
One last note: It is important to know the assumptions we make in using the 2 sample t-test.
  • Characteristics of the Dependent Variable: It is assumed that y is interval, continuous, and normally distributed.
  • Homogeneity of Variance: We assume that the variances are equal for both groups in the population. If the sample estimates are vastly different, such as 9:1 or 3:1, then you probably have violated this assumption. As you can see, the two sample estimates have to be very different from each other before we worry about the assumption. For this reason we say that t is robust with regard to violations of this assumption. In other words, t still works well, unless the sample variances are drastically different from each other.

When homogeneity of variance is violated, Hays suggests use of the following modified 2 group tdf for independent samples.

Picture (446x140, 3.5Kb)