t-test testing inferences about population means
TRANSCRIPT
t-test
Testing Inferences about Population Means
Learning Objectives Compute by hand and interpret
Single sample t Independent samples t Dependent samples t
Use SPSS to compute the same tests and interpret the output
Review 6 Steps for Significance Testing
1. Set alpha (p level).2. State hypotheses, Null and
Alternative.3. Calculate the test statistic (sample
value).
4. Find the critical value of the statistic.
5. State the decision rule.6. State the conclusion.
One Sample Exercise (1)
1. Set alpha. = .052. State hypotheses.
Null hypothesis is H0: = 1000. Alternative hypothesis is H1: 1000.
3. Calculate the test statistic
Testing whether light bulbs have a life of 1000 hours
Calculating the Single Sample t800750940970790980820760
1000860
What is the mean of our sample? = 867
What is the standard deviation for our sample of light bulbs?
SD= 96.73
35.459.30
1000867
XX S
Xt
59.3010
73.96
N
SDSE
X
Determining Significance
4. Determine the critical value. Look up in the table (Heiman, p. 708). Looking for alpha = .05, two tails with df = 10-1 = 9. Table says 2.262.
5. State decision rule. If absolute value of sample is greater than critical value, reject null. If |-4.35| > |2.262|, reject H0.
α(1 tail) 0.05 0.025 0.05 0.025 0.05 0.025 0.05 0.025 0.05 0.025
α(2 tail) 0.10 0.050 0.10 0.050 0.10 0.050 0.10 0.050 0.10 0.050
df df df df df
1 6.3138 12.707 21 1.7207 2.0796 41 1.6829 2.0196 61 1.6702 1.9996 81 1.6639 1.9897
2 2.9200 4.3026 22 1.7172 2.0739 42 1.6820 2.0181 62 1.6698 1.9990 82 1.6636 1.9893
3 2.3534 3.1824 23 1.7139 2.0686 43 1.6811 2.0167 63 1.6694 1.9983 83 1.6634 1.9889
4 2.1319 2.7764 24 1.7109 2.0639 44 1.6802 2.0154 64 1.6690 1.9977 84 1.6632 1.9886
5 2.0150 2.5706 25 1.7081 2.0596 45 1.6794 2.0141 65 1.6686 1.9971 85 1.6630 1.9883
6 1.9432 2.4469 26 1.7056 2.0555 46 1.6787 2.0129 66 1.6683 1.9966 86 1.6628 1.9879
7 1.8946 2.3646 27 1.7033 2.0518 47 1.6779 2.0117 67 1.6679 1.9960 87 1.6626 1.9876
8 1.8595 2.3060 28 1.7011 2.0484 48 1.6772 2.0106 68 1.6676 1.9955 88 1.6623 1.9873
9 1.8331 2.2621 29 1.6991 2.0452 49 1.6766 2.0096 69 1.6673 1.9950 89 1.6622 1.9870
10 1.8124 2.2282 30 1.6973 2.0423 50 1.6759 2.0086 70 1.6669 1.9944 90 1.6620 1.9867
11 1.7959 2.2010 31 1.6955 2.0395 51 1.6753 2.0076 71 1.6666 1.9939 91 1.6618 1.9864
12 1.7823 2.1788 32 1.6939 2.0369 52 1.6747 2.0066 72 1.6663 1.9935 92 1.6616 1.9861
13 1.7709 2.1604 33 1.6924 2.0345 53 1.6741 2.0057 73 1.6660 1.9930 93 1.6614 1.9858
14 1.7613 2.1448 34 1.6909 2.0322 54 1.6736 2.0049 74 1.6657 1.9925 94 1.6612 1.9855
15 1.7530 2.1314 35 1.6896 2.0301 55 1.6730 2.0041 75 1.6654 1.9921 95 1.6610 1.9852
16 1.7459 2.1199 36 1.6883 2.0281 56 1.6725 2.0032 76 1.6652 1.9917 96 1.6609 1.9850
17 1.7396 2.1098 37 1.6871 2.0262 57 1.6720 2.0025 77 1.6649 1.9913 97 1.6607 1.9847
18 1.7341 2.1009 38 1.6859 2.0244 58 1.6715 2.0017 78 1.6646 1.9909 98 1.6606 1.9845
19 1.7291 2.0930 39 1.6849 2.0227 59 1.6711 2.0010 79 1.6644 1.9904 99 1.6604 1.9842
20 1.7247 2.0860 40 1.6839 2.0211 60 1.6706 2.0003 80 1.6641 1.9901 100 1.6602 1.9840
Stating the Conclusion 6. State the conclusion. We reject the
null hypothesis that the bulbs were drawn from a population in which the average life is 1000 hrs. The difference between our sample mean (867) and the mean of the population (1000) is SO different that it is unlikely that our sample could have been drawn from a population with an average life of 1000 hours.
One-Sample Statistics
10 867.0000 96.7299 30.5887BULBLIFEN Mean Std. Deviation
Std. ErrorMean
One-Sample Test
-4.348 9 .002 -133.0000 -202.1964 -63.8036BULBLIFEt df Sig. (2-tailed)
MeanDifference Lower Upper
95% ConfidenceInterval of the
Difference
Test Value = 1000
SPSS Results
Computers print p values rather than critical values. If p (Sig.) is less than .05, it’s significant.
t-tests with Two Samples
Independent Samples t-test
Dependent Samples t-test
Independent Samples t-test Used when we have two independent
samples, e.g., treatment and control groups.
Formula is: Terms in the numerator are the sample
means. Term in the denominator is the standard
error of the difference between means.
diffXX SE
XXt 21
21
Independent samples t-test
The formula for the standard error of the difference in means:
2
22
1
21
N
SD
N
SDSEdiff
Suppose we study the effect of caffeine on a motor test where the task is to keep a the mouse centered on a moving dot. Everyone gets a drink; half get caffeine, half get placebo; nobody knows who got what.
Independent Sample Data (Data are time off task)
Experimental (Caff) Control (No Caffeine)12 21
14 18
10 14
8 20
16 11
5 19
3 8
9 12
11 13
15
N1=9, M1=9.778, SD1=4.1164 N2=10, M2=15.1, SD2=4.2805
Independent Sample Steps(1)
1. Set alpha. Alpha = .052. State Hypotheses.
Null is H0: 1 = 2.
Alternative is H1: 1 2.
Independent Sample Steps(2)
3. Calculate test statistic:
93.110
)2805.4(
9
)1164.4( 22
2
22
1
21
N
SD
N
SDSEdiff
758.293.1
322.5
93.1
1.15778.921
diffSE
XXt
Independent Sample Steps (3)
4. Determine the critical value. Alpha is .05, 2 tails, and df = N1+N2-2 or 10+9-2 = 17. The value is 2.11.
5. State decision rule. If |-2.758| > 2.11, then reject the null.
6. Conclusion: Reject the null. the population means are different. Caffeine has an effect on the motor pursuit task.
α(1 tail) 0.05 0.025 0.05 0.025 0.05 0.025 0.05 0.025 0.05 0.025
α(2 tail) 0.10 0.050 0.10 0.050 0.10 0.050 0.10 0.050 0.10 0.050
df df df df df
1 6.3138 12.707 21 1.7207 2.0796 41 1.6829 2.0196 61 1.6702 1.9996 81 1.6639 1.9897
2 2.9200 4.3026 22 1.7172 2.0739 42 1.6820 2.0181 62 1.6698 1.9990 82 1.6636 1.9893
3 2.3534 3.1824 23 1.7139 2.0686 43 1.6811 2.0167 63 1.6694 1.9983 83 1.6634 1.9889
4 2.1319 2.7764 24 1.7109 2.0639 44 1.6802 2.0154 64 1.6690 1.9977 84 1.6632 1.9886
5 2.0150 2.5706 25 1.7081 2.0596 45 1.6794 2.0141 65 1.6686 1.9971 85 1.6630 1.9883
6 1.9432 2.4469 26 1.7056 2.0555 46 1.6787 2.0129 66 1.6683 1.9966 86 1.6628 1.9879
7 1.8946 2.3646 27 1.7033 2.0518 47 1.6779 2.0117 67 1.6679 1.9960 87 1.6626 1.9876
8 1.8595 2.3060 28 1.7011 2.0484 48 1.6772 2.0106 68 1.6676 1.9955 88 1.6623 1.9873
9 1.8331 2.2621 29 1.6991 2.0452 49 1.6766 2.0096 69 1.6673 1.9950 89 1.6622 1.9870
10 1.8124 2.2282 30 1.6973 2.0423 50 1.6759 2.0086 70 1.6669 1.9944 90 1.6620 1.9867
11 1.7959 2.2010 31 1.6955 2.0395 51 1.6753 2.0076 71 1.6666 1.9939 91 1.6618 1.9864
12 1.7823 2.1788 32 1.6939 2.0369 52 1.6747 2.0066 72 1.6663 1.9935 92 1.6616 1.9861
13 1.7709 2.1604 33 1.6924 2.0345 53 1.6741 2.0057 73 1.6660 1.9930 93 1.6614 1.9858
14 1.7613 2.1448 34 1.6909 2.0322 54 1.6736 2.0049 74 1.6657 1.9925 94 1.6612 1.9855
15 1.7530 2.1314 35 1.6896 2.0301 55 1.6730 2.0041 75 1.6654 1.9921 95 1.6610 1.9852
16 1.7459 2.1199 36 1.6883 2.0281 56 1.6725 2.0032 76 1.6652 1.9917 96 1.6609 1.9850
17 1.7396 2.1098 37 1.6871 2.0262 57 1.6720 2.0025 77 1.6649 1.9913 97 1.6607 1.9847
18 1.7341 2.1009 38 1.6859 2.0244 58 1.6715 2.0017 78 1.6646 1.9909 98 1.6606 1.9845
19 1.7291 2.0930 39 1.6849 2.0227 59 1.6711 2.0010 79 1.6644 1.9904 99 1.6604 1.9842
20 1.7247 2.0860 40 1.6839 2.0211 60 1.6706 2.0003 80 1.6641 1.9901 100 1.6602 1.9840
Independent Samples Test
Levene's Test for Equality of
Variances t-test for Equality of Means
F Sig. t df
time Equal variances assumed .135 .718 2.755 17
Equal variances not
assumed 2.761 16.911
Independent Samples Test
t-test for Equality of Means
Sig. (2-tailed) Mean Difference
Std. Error
Difference
time Equal variances assumed .014 5.322 1.932
Equal variances not
assumed
.013 5.322 1.927
Independent Samples Test
t-test for Equality of Means
95% Confidence Interval of the
Difference
Lower Upper
time Equal variances assumed 1.247 9.398
Equal variances not
assumed
1.254 9.390
Using SPSS
Independent Samples Exercise
Experimental Control
12 20
14 18
10 148 2016
Work this problem by hand and with SPSS. You will have to enter the data into SPSS.
Group Statistics
5 12.0000 3.1623 1.4142
4 18.0000 2.8284 1.4142
GROUPexperimental group
control group
TIMEN Mean Std. Deviation
Std. ErrorMean
Independent Samples Test
.130 .729 -2.958 7 .021 -6.0000 2.0284 -10.7963 -1.2037
-3.000 6.857 .020 -6.0000 2.0000 -10.7493 -1.2507
Equal variancesassumed
Equal variancesnot assumed
TIMEF Sig.
Levene's Test forEquality of Variances
t df Sig. (2-tailed)Mean
DifferenceStd. ErrorDifference Lower Upper
95% ConfidenceInterval of the
Difference
t-test for Equality of Means
SPSS Results
Dependent Samples t-tests
Dependent Samples t-test Used when we have dependent samples –
matched, paired or tied somehow Repeated measures Brother & sister, husband & wife Left hand, right hand, etc.
Useful to control individual differences. Can result in more powerful test than independent samples t-test.
Dependent Samples tFormulas:
diffX SE
Dt
D
t is the difference in means over a standard error.
pairs
Ddiff
n
SDSE
The standard error is found by finding the difference between each pair of observations. The standard deviation of these difference is SDD. Divide SDD by sqrt(number of pairs) to get SEdiff.
Another way to write the formula
pairs
DX
nSD
Dt
D
Dependent Samples t example
Person TX (time in sec)
Placebo Difference
1 60 55 5
2 35 20 15
3 70 60 10
4 50 45 5
5 60 60 0
M 55 48 7
SD 13.23 16.81 5.70
Dependent Samples t Example (2)
55.25
70.5
pairs
diffn
SDSE
75.255.2
7
55.2
4855
diffSE
Dt
1. Set alpha = .052. Null hypothesis: H0: 1 = 2. Alternative
is H1: 1 2.
3. Calculate the test statistic:
Dependent Samples t Example (3)
4. Determine the critical value of t. Alpha =.05, tails=2 df = N(pairs)-1 =5-1=4. Critical value is 2.776
5. Decision rule: is absolute value of sample value larger than critical value?
6. Conclusion. Not (quite) significant. Painfree does not have an effect.
Using SPSS for dependent t-test
Paired Samples Statistics
Mean N Std. Deviation Std. Error Mean
Pair 1 TX 55.00 5 13.229 5.916
Placebo 48.00 5 16.808 7.517
Paired Samples Test
Paired Differences
Mean Std. Deviation Std. Error Mean
95% Confidence Interval of the
Difference
Lower Upper
Pair 1 TX - Placebo 7.000 5.701 2.550 -.079 14.079
Paired Samples Test
t df Sig. (2-tailed)
Pair 1 TX - Placebo 2.746 4 .052