1 Psy 521/621 Lab 4 Activities t-tests Learning Objectives: Learn to conduct and interpret the t-test for dependent samples Learn to conduct and interpret the t-test for independent samples To accomplish these learning objectives, we will focus on the end-of-lesson exercises in Lessons 23 and 24 of the Green and Salkind book. T-test for dependent samples (AKA, the paired-sample t-test) DATA FILE: Lesson 23 Exercise File 1.sav Exercise 1 (excerpted from Green & Salkind Lesson 23) Mike wants to know if overall life stress increases or decreases as working women get older. He obtains scores on the Index of Life Stress (ILS) from a group of 100 working women when they are 40 years old, and he gets ILS scores again from 45 of these women when they are 60 years old. The ILS consists of two scores, interpersonal life stress and occupational life stress. The two scores combine to form an index of overall life stress. The SPSS file contains 45 cases, one for each woman, and four variables: interpersonal stress at 40, occupational stress at 40, interpersonal stress at 60, and occupational stress at 60. 1. Compute scores to obtain a total ILS at age 40 and age 60. Transformcompute. Target variable = ILS_40. Numeric expression = inter_40 + occup_40. OK. Transformcompute. Target variable = ILS_60. Numeric expression = inter_60 + occup_60. OK. 2. Compute a paired-samples t-test to determine whether overall life stress changes with age. Click Analyze Compare MeansPaired-Samples T Test. Click ILS_40 and ILS_40 will appear as Variable 1 in Current Selections. Hold down the ctrl button and click ILS_60 and ILS_60. It will appear as Variable 2 in Current Selections. Both variables should be highlighted in the box above. Click ► and “ILS_40-ILS_60” will appear in the Paired Variables box. Click OK. NOTE: If a participant is missing data for either variable, SPSS will not include them in the analysis. 2 T-Test Paired Samples Statistics Pair 1 ILS_40 ILS_60 Mean 151.8444 136.8667 N 45 45 Std. Error Mean 2.15907 1.48310 Std. Deviation 14.48346 9.94896 Pa ired Sa mples Correlations N Pair 1 ILS_40 & ILS_60 45 Correlation .037 Sig. .810 Pa ired Sa mples Test Paired Differences Pair 1 ILS_40 - ILS_60 Mean 14.9778 Std. Deviation 17.26595 Std. Error Mean 2.57386 95% Confidence Interval of the Difference Lower Upper 9.7905 20.1650 t 5.819 df 44 We now have a p-value? What are our two questions? 1) What’s the null hypothesis? H0: Mean life stress at 40 = mean life stress at 60 2) Did we reject the null? Yes. So, what exactly did we find? Let’s look at our means: the mean for ILS_40 is higher than the mean for ILS_60, so it looks like life stress decreased with age in this sample. 3. Create a difference variable to show the changes in life stress from 40 to 60 for each woman. Create a histogram to show these changes graphically. Transformcompute. Target variable = ILS_chng. Numeric expression = ILS _60 - ILS _40. In interpreting this variable, positive scores mean participant’s stress increased with age and negative scores tell you that the participant’s stress decreased with age. If we computed ILS_ 40 – ILS_60 the interpretation would be just the opposite (i.e., pos scores = stress decreases, neg scores = stress increases). Click OK. Click GraphHistogram. Move ILS_change to Variable. Click OK. Sig. (2-tailed) .000 3 FYI: Conducting a one-sample t-test on the ILS_chng variable would give you the same results as those above. Graph 7 6 5 4 3 2 Std. Dev = 17.27 1 Mean = -15.0 N = 45.00 0 -50.0 -40.0 -45.0 -30.0 -35.0 -20.0 -25.0 -10.0 -15.0 0.0 -5.0 10.0 5.0 20.0 15.0 30.0 25.0 ILS_CHNG 4. Conduct a paired-samples t-test to determine whether (a) occupational stress, and (b) interpersonal stress increase or decrease with age. Occupational Stress Click Analyze Compare MeansPaired-Samples T Test. Click occup_40 and occup_40 will appear as Variable 1 in Current Selections. Click occup_60 and occup_60 will appear as Variable 2 in Current Selections. Click ► and occup_40-occup_60 will appear in the Paired Variables box. Click OK. Paired Samples Statistics Mean Pair 1 Occupational life stress at age 40 Occupational life stress at age 60 N Std. Deviation Std. Error Mean 73.64 45 9.547 1.423 61.87 45 6.625 .988 4 Paired Samples Correlations N Pair 1 Occupational life stress at age 40 & Occupational life stress at age 60 Correlation 45 Sig. -.207 .173 Pa ired Sa mpl es Test Paired Differences Mean Pair 1 Oc cupational life st ress at age 40 - Occ upational life stress at age 60 St d. Deviat ion St d. Error Mean 12.696 1.893 11.778 95% Confidenc e Int erval of t he Difference Lower Upper 7.964 15.592 t 6.223 Again, we have a p-value, so what do we ask? 1) What’s the null? H0: Occ. stress at 40 = occ. stress at 60 2) Did we reject the null? Yes. Occupational stress is higher at age 40 than it is at age 60. Interpersonal Stress Click Analyze Compare MeansPaired-Samples T Test. Click inter_40 and inter_40 will appear as Variable 1 in Current Selections. Click inter_60 and inter_60 will appear as Variable 2 in Current Selections. Click ► and inter_40-inter_60 will appear in the Paired Variables box. Click OK. Paired Samples Statistics Mean Pair 1 Interpersonal life stress at age 40 Interpersonal life stress at age 60 N Std. Deviation Std. Error Mean 78.20 45 11.655 1.737 75.00 45 7.711 1.149 Paired Samples Correlations N Pair 1 Interpersonal life stress at age 40 & Interpersonal life stress at age 60 Correlation 45 .005 Sig. .974 df Sig. (2-tailed) 44 .000 5 Pa ired Sa mples Test Paired Differences Mean Pair 1 Interpersonal life stress at age 40 - Interpersonal life stress at age 60 3.20 Std. Deviation Std. Error Mean 13.942 2.078 95% Confidence Interval of the Difference Lower Upper -.99 7.39 t 1.540 df Sig. (2-tailed) 44 Our two questions again: 1) What’s the null? H0: Interp. stress at 40 = interp. stress at 60 2) Did we reject the null? No. Interpersonal stress at age 40 does not appear to be significantly different than it is at age 60. 5. Let’s see what our results might look like in an APA style write-up. A paired samples t test was conducted to evaluate whether women’s life stress declined from age 40 to 60. The results indicated that the mean overall life stress index at age 40 (M = 151.84, SD = 14.48) was significantly greater than the mean overall life stress index at age 60 (M = 136.87, SD = 9.95), t(44) = 5.82, p < .001. For most women, overall life stress scores declined over the 20-year period. Two separate paired-samples t tests were conducted to evaluate whether the change in life stress from age 40 to age 60 was due to interpersonal stress, occupational stress, or both. The results indicated that interpersonal stress levels did not differ significantly from age 40 (M = 78.20, SD = 11.66) to age 60 (M = 75.00, SD = 7.71), t(44) = 1.54, p = .13, but that women’s occupational stress decreased significantly from age 40 (M = 73.64, SD = 9.55) to age 60 (M = 61.87, SD = 6.23), t(44) = 6.22, p < .001. Therefore, the decline in life stress was primarily a function of the decrease in occupational stress. Note: means and standard deviations could be displayed in a table rather than in the text, as long as the text refers the reader to the table. DATA FILE: Lesson 23 Exercise File 2.sav Kristy is interested in investigating whether husbands and wives who are having infertility problems feel equally anxious. Twenty-four couples agree to participate. Husbands and wives both take the Infertility Anxiety Measure (IAM). Higher scores on the IAM indicate more anxiety related to infertility. The SPSS data file contains 24 cases, one for each husband-wife pair, and two variables: husband IAM score and wife IAM score. Conduct a paired samples t-test on these data. Click Analyze Compare MeansPaired-Samples T Test. Click husband and husband will appear as Variable 1 in Current Selections. Click wife and wife will appear as .131 6 Variable 2 in Current Selections. Click ► and husband-wife will appear in the Paired Variables box. Click OK. T-Test Paired Samples Statistics Mean Pair 1 Husband's infertility anxiety score Wife's infertility anxiety score N Std. Deviation Std. Error Mean 57.46 24 7.337 1.498 62.54 24 12.441 2.540 Paired Samples Correlations N Pair 1 Husband's infertility anxiety score & Wife's infertility anxiety score Correlation 24 .822 Sig. .000 Pa ired Sa mpl es Test Paired Differenc es Mean Pair 1 Husband's infertility anxiety score - Wife's infertility anxiet y sc ore St d. Deviat ion St d. Error Mean 7.649 1.561 -5. 083 95% Confidenc e Int erval of t he Difference Lower Upper -8. 313 -1. 853 t df -3. 256 Let’s identify: Mean IAM scores for husbands: 57.46 Mean IAM scores for wives: 62.54 What’s the null hypothesis here? H0: husband IAM = wife IAM Did we reject the null? Yes Let’s create a boxplot to see what the differences between husband and wife scores on the IAM look like graphically. Graphs Boxplot Summaries of separate variables. Move Husband and Wife into the Boxes Represent box. Click OK. Sig. (2-tailed) 23 .003 7 90 2 80 2 70 60 50 21 40 30 N= 24 Husband's infertilit 24 Wife's infertility a How would we compute an effect size for this test? d = mean of the diff scores SD of the diff scores alternatively, but equivalently: d = t_ √N (where N = #pairs) You can get the values to plug into this equation from the Paired Samples Test output. What is d for these data? d = -5.083/7.649 = -.66 OR d = -3.256/√24 = -.66 Let’s see what an APA results section would look like for this test: A paired samples t test was conducted to evaluate whether husbands or wives differed on their levels of infertility anxiety. The results indicated that wives (M = 62.54, SD = 12.44) were significantly more anxious about infertility than their husbands (M = 57.46, SD = 7.34), t(23) = -3.26, p < .01. A boxplot of the data is presented in Figure XX. The 95% confidence interval for the mean difference in fertility anxiety between husbands and wives was -8.31 to -1.35. Finally d = -.66, indicating that mean anxiety score for husbands is .66 standard deviations below the mean anxiety score for their wives. This is a medium effect. 8 T-test for independent samples DATA FILE: Lesson 24 Exercise File 1.sav Billie wants to test the hypothesis that overweight individuals eat faster than normalweight individuals. She has two assistants sit in a McDonald’s restaurant and identify individuals who order the Big Mac special (Big Mac, large fries, large Coke) for lunch. The Big Mackers, as they are affectionately called by the researchers, are classified as overweight, normal-weight, or neither overweight nor normal-weight. The assistants identify 10 overweight and 30 normal-weight Big Mackers. The time it takes for the individuals to complete their Big Mac specials is recorded by the assistants. The SPSS data file contains two variables: a grouping variable with two levels (overweight = 1, normal-weight = 2) and time in seconds to eat the meal. 1. Compute an independent-samples t test on these data. Click AnalyzeCompare MeansIndependent Samples T Test. Move “Time Spent” to Test Variable box. Move “Weight” to Grouping Variable. NOTE: ALWAYS GROUP BY CATEGORICAL VARIABLE. Click Define Groups. In Group one box, type in 1 and in Group 2 box, type in 2. Click Continue. Click OK. T-Test Group Statistics Time s pent eating Big Mac specials in seconds Weight clas sification normal weight over weight N 10 30 Mean 589.00 698.40 Std. Deviation 42.615 82.949 Std. Error Mean 13.476 15.144 Independent Samples Test Levene's Test for Equality of Variances F Time s pent eating Big Mac specials in seconds Equal variances as sumed Equal variances not ass umed 2.745 Sig. .106 t-test for Equality of Means t df Sig. (2-tailed) Mean Difference Std. Error Difference 95% Confidence Interval of the Difference Lower Upper -3.975 38 .000 -109.40 27.522 -165.116 -53.684 -5.397 30.828 .000 -109.40 20.272 -150.754 -68.046 1. What are the t and p values when equal variances are assumed and not assumed? Assuming equal population variances: t(38) = -3.98, p < .001. Not assuming equal population variances: t(31) = -5.40, p < .001. -- Is the t test significant? Yes. We would reject the null hypothesis that mean eating time for overweight and normal weight individuals is equal.-- 9 2. a. Mean eating time for overweight individuals = 589 seconds. b. Standard deviation for normal weight individuals = 82.95 seconds. c. Results for the Levene’s test of homogeneity: F(1, 38) = 2.75, p > .05. Levene’s test is not significant. What does that mean? Well, what is our null hypothesis? H0: population variance of time spent eating Big Mac specials for normal weight individuals = population variance of time spent eating Big Mac specials for over weight individuals. 3. Let’s compute an effect size for this statistic: d = Mean Difference/SDpooled SDpooled = Sq. Root of (N1 – 1)SD21 + (N2 – 1)SD22 N1 + N2 – 2 =Sq. Root of (9*1817) + (29*6881) =Sq. Root of 16353 +199549 =Sq. Root of 215888/10 + 30 – 2 = 75.37 d = -109.4/ 75.37 = -1.45 Alternatively, you can compute d with this formula: d = t * √[(N1 + N2) / (N1*N2)] 4. Create a boxplot to summarize the results graphically Graphs Boxplot Summaries for groups of cases. Move “time spent” to the Variable box and “Weight” to the Category Axis box. Time spent eating Big Mac specials in seconds 1000 900 800 700 600 500 400 N= 10 normal weight 30 over weight Weight classification 5. Here is a sample APA results section: An independent-samples t test was conducted to evaluate the hypothesis that overweight individuals tend to eat faster than normal weight individuals. Overweight individuals did 10 eat significantly more quickly (M = 589, SD = 42.62) than normal weight individuals (M = 698, SD = 82.95), t(38) = -3.98 , p < .001, d = -.24. DATA FILE: Lesson 24 Exercise File 2 Fred wants to determine whether mainstreaming special needs children into regular classrooms will help or hurt the academic achievement of the non-special needs children. Two 7th grade teachers in two similar junior high schools have allowed him to use their classrooms as samples. One school has recently integrated special needs children in regular classrooms, while the other has not. Fred is supplied with the student’s raw scores on a standardized achievement test at the beginning of the year and the end of the year. The SPSS data file contains 40 cases and three variables: 1) integrat with 2 levels (1 = classroom has not been integrated, and 2 = classroom has been integrated); 2) pretest, which are raw scores on the standardized test at the beginning of the year, and 3) posttest, which are raw scores on the standardized test at the end of the year. 6. Create a dependent variable by computing a difference score between pretest and posttest achievement scores. Transformcompute. Target variable = ach_change. Numeric expression = posttest pretest. (Note: When you subtract posttest from pretest, positive scores tell you that the participant’s score (achievement) increased over the school year and negative scores tell you that the participant’s score (achievement) decreased over the school year). Click OK. 7. Conduct an independent-samples t test to evaluate the effect of integration on academic achievement. Click AnalyzeCompare MeansIndependent Samples T Test. Move Ach_change to Test Variable. Move Integrat to Grouping Variable. Click Define Groups. In Group one box, type 1 and in Group 2 box, type 2. Click Continue. Click OK. T-Test Group Statistics ach_change Classroom integration not integrated integrated N 15 25 Mean 1.5333 9.6000 Std. Deviation 7.40527 16.54287 Std. Error Mean 1.91203 3.30857 Independent Samples Test Levene's Test for Equality of Variances F ach_change Equal variances as sumed Equal variances not ass umed 4.098 Sig. .050 t-test for Equality of Means t df Sig. (2-tailed) Mean Difference Std. Error Difference 95% Confidence Interval of the Difference Lower Upper -1.778 38 .083 -8.06667 4.53779 -17.25294 1.11961 -2.111 35.852 .042 -8.06667 3.82133 -15.81779 -.31555 11 8. What are the results of Levene’s test? F(1, 38) = 4.10, p = .05. Levene’s test is significant, so we reject the null hypothesis that the variances are equal across the grouping variable. In other words, we would conclude that the variance in ach_chng for those in the integrated classroom is not equal to the variance in ach_chng for those in the non-integrated classroom. 9. Given the significant Levene’s test, we will report the results where equal variances are not assumed: t(35.85) = -2.11, p = .04. 10. Let’s put together a sample APA results section and compute a new effect size. An independent-samples t test was conducted to evaluate the effect of integration on the achievement scores of regular students. Regular students in integrated classrooms achieved significantly greater gains in achievement scores (M = 1.53, SD = 7.41) than students in non-integrated classrooms (M = 9.60, SD = 16.54), t(35.85) = -2.11 , p = .04, η2 = .10. As an alternative to d, you could compute η2 η2 = _____t2_______ = ____(-2.11)2_____ = __4.452___ = .10 t2 + (N1 + N2 – 2) (-2.11)2 + (15+25-2) 4.452 + 38 η2 is interpreted as the proportion of variance in the dependent variable that can be accounted for by group membership. So in this case we would say that 10% of the variance in the change in achievement scores is accounted for by which classroom a student was in (integrated v. non-integrated). The interpretation for η2 is like that of R2, which you will learn more about later. Rules of thumb for η2: small = .01 medium = .06 large = .14