The t-test: So Far: Sampling distribution benefit is that even if the original population is not normal, a sampling distribution based on this population will be normal (for sample size > 30). Benefit of a normal distribution is that we know what proportion of means lie within a certain margin of the mean. The distances from the mean are best understood in terms of z- scores. Example of a non-normal or skewed distribution: Annual income of Americans. Many people in the lower and medium income bracket; very few are ultra rich. (So distribution is NOT normal.) Today: Single sample and Independent-measures (between-subjects) tests Frequency Next week: Repeated-measures (within-subjects) test Low Income High Sampling distribution based on a skewed population distribution A z-score for a sample mean tells us where in the distribution the particular mean lies z = -2 z = -1 z = 0 z = +1 z = +2 µ = mean σ X = standard deviation µ 3σ X µ 2σ X µ σ X µ µ +σ X µ + 2σ X µ + 3σ X From the z-score we can decide how many sample means are above/below that particular mean. 1
For example for z = +1 15.87% means lie above it and 84.13% means lie below it z = -1.96 z = +1 z = +1.96 From last week: Hypothesis testing 1. Small difference between sample mean and population mean retain null hypothesis (difference has occurred by chance). Large difference reject null hypothesis in favour of alternative hypothesis (difference has not occurred by chance, it is real. (OR a large difference can occur by chance only very rarely). 2. "Large" is a difference that is likely to occur by chance only 5% of the time or less (p <.05) a compromise between Type 1 and Type 2 errors. 3. Directional hypothesis versus non-directional hypothesis. µ 3σ X µ 2σ X µ σ X µ µ +σ X µ + 2σ X µ + 3σ X Two new things today: 1) We use the z-test when we know the population SD. When we don t know the population SD, we calculate SD from the sample, and use the t-test. z = X µ σ X t = X µ 2) We have been discussing single samples. - Reason: Learning how to work single samples is easier (less computation). - Today we ll learn how to deal with two samples. TWO DIFFERENCES between a z-test and a t-test: (1): When population SD (σ) is known we use to compute the error term for the z-test. BUT if we don t know σ, we do a t-test, and we calculate what is called an unbiased sample SD (ŝ) as follows: (X i X ) 2 s ˆ = N 1 2 sum of squares = SS = (X i X ) Then we use ŝ to compute what is called the estimated error term ( ) as follows: estσ = s ˆ X N σ N 2
(2): In performing a t-test we use a t-distribution. t-distribution is used the same way as the z-distribution, BUT unlike the z-distribution there are as many different t-distributions. And which one we use will depend on sample size, and the df = degrees of freedom. df = N - 1 Example: Suppose a city s year-four children take a maths exam and produce µ = 75. At the beginning of the year 26 children are chosen at random to take part in an experiment, which involves special teaching methods. At the end of the year this group produces X = 81. Population standard deviation is unknown; the unbiased sample standard deviation is ŝ = 16.317. Did the special teaching methods work? We choose α = 0.05 WE WILL USE THE t-test. NOTE: POPULATION SD IS NOT KNOWN H 0 : µ s = 75 (no effect) H 1 : µ s 75 (there is an effect) Hypothesis testing from last week: If z-observed z-critical then reject H 0 Finding t-critical from the t-distribution Comparison of t-distributions for df = 4 and df = 25; α = 0.05 Now it is: If t-observed t-critical then reject H 0 Before we find t-critical we need to find out which distribution to look at For sample size 26; df = 25 Portion of a table of critical values of t (two tailed) If t-observed 2.060 then reject H 0 3
Calculating t-observed Calculating t-observed t is computed the same way as z, except we use an estimate of σ X ( ) t = X µ = ˆ s N Computing z-observed versus t-observed z = X µ σ X t = X µ σ X = σ N = ˆ s N 81 75 t = 16.317 26 = 6 3.2 =1.88 Since this is smaller than t-critical; we fail to reject the null hypothesis. If our hypothesis was directional (one-tailed): Special teaching methods will improve the maths score Then we would have been successful in rejecting the null hypothesis as t-critical = 1.708 (for a one-tailed test, at α =.05) two-tailed df = 25 lower t-critical value -2.060 upper t-critical value 2.060 0.025 0.025 t-critical value 1.708 one-tailed df = 25 0.05 Two-Sample Experiment This involves more complex computations, BUT it is much more applicable in everyday life. Independent measures t-test. 4
Working with two samples: Using subscripts - Stating the null hypothesis: µ 1 - µ 2 = 0 - Two sample means:, - The error term: 1 - Two sample sizes : N 1, N 2 - Two degrees of freedom df 1, df 2 EXAMPLE: Experiment on the effects of alcohol on task performance (time taken to type 20 words). Measure time taken to perform the task for one set of subjects when under the influence of alcohol, and a different set of subjects when sober. Null hypothesis: alcohol has no effect on time taken: variation between the drunk sample mean and the sober sample mean is due to sampling variation. i.e. The drunk and sober mean performance times are based on samples from the same population. Subject group 1 Subject group 2 Participant 1 13.0 Participant 1 11.1 Participant 2 16.5 Participant 2 13.5 Participant 3 16.9 Participant 3 11.0 Participant 4 19.7 Participant 4 9.1 Participant 5 17.6 Participant 5 13.3 Participant 6 17.5 Participant 6 11.7 Participant 7 18.1 Participant 7 14.3 Participant 8 17.3 Participant 8 10.8 Participant 9 14.5 Participant 9 12.6 Participant 10 13.3 Participant 10 11.2 t = ( ) (µ 1 µ 2 )hypothesized 1 the difference between samples means (should be close to zero if there is no difference between the two conditions) the predicted average difference between scores in our two samples (usually zero, since we assume the two samples don t differ ) estimated standard error of the difference between means (a measure of how much the difference between means might vary from one occasion to the next). 5
1 t = ( ) (µ 1 µ 2 )hypothesized 1 = 4.58 Subject group 1 Subject group 2 Participant 1 13.0 Participant 1 11.1 Participant 2 16.5 Participant 2 13.5 Participant 3 16.9 Participant 3 11.0 Participant 4 19.7 Participant 4 9.1 Participant 5 17.6 Participant 5 13.3 Participant 6 17.5 Participant 6 11.7 Participant 7 18.1 Participant 7 14.3 Participant 8 17.3 Participant 8 10.8 Participant 9 14.5 Participant 9 12.6 Participant 10 13.3 Participant 10 11.2 =164.4 =16.44 =118.6 =11.86 s p 2 = 2 t = ( ) (µ 1 µ 2 )hypothesized 1 2a Calculating pooled variance 2 ( ) + (X2 ) 2 df 1 + df 2 s p 2 = SS 1 + SS 2 df 1 + df 2 2b Calculating two sample standard error 1 = s 2 p + s 2 p N 1 N 2 2a Participant 1 Participant 2 Participant 3 Participant 4 Participant 5 Participant 6 Participant 7 Participant 8 Participant 9 Participant 10 SS 1 = ( ) =16.44 13 11.83 16.5 0.004 16.9 0.21 19.7 10.63 17.6 1.35 17.5 1.12 18.1 2.76 17.3 0.74 14.5 3.76 13.3 9.86 Participant 1 Participant 2 Participant 3 Participant 4 Participant 5 Participant 6 Participant 7 Participant 8 Participant 9 Participant 10 =11.86 Subject group 1 Subject group 2 X ( ) 2 ( ) 2 1 11.1 0.58 13.5 2.69 11 0.74 9.1 7.62 13.3 2.07 11.7 0.03 14.3 5.95 10.8 1.12 12.6 0.55 11.2 0.44 2 2 = 42.26 SS2 = ( ) = 21.78 2a 2b s p 2 = N 1 = 10; df =9 N 2 = 10; df=9 s p 2 = SS 1 + SS 2 df 1 + df 2 42.26 + 21.78 9 + 9 1 = s 2 p + s 2 p = 3.56 N 1 N 2 10 + 3.56 10 = 3.56 = 0.356 2 = 0.843 6
t(observed) = ( ) (µ 1 µ 2 )hypothesized 1 3 Frequently µ 1 µ 2 = 0 6 t = 4.58 0 0.843 = 5.429 4 5 df = (N 1 1)+(N 2 1) = 18 finding t-critical from the table: t-critical = 2.10; df = 18 7 Decision: t-observed > t-critical Therefore reject the null hypothesis Alcohol has an impact of time taken on the task. t(18) = 5.429, p < 0.05 Data Entry Using SPSS to do an independent measures t-test 7
Running SPSS (independent measures t-test) Running SPSS (independent measures t-test) Running SPSS (independent measures t-test) Running SPSS (independent measures t-test) 8
SPSS output (independent measures t-test) 9