T-tests

advertisement
T-tests
Inference When the Population
Standard Deviation Is Not Known.
Psychology 302 Quantitative and Psychometric Methods
1
Psychology 302 Quantitative and Psychometric Methods
2
Correlation between prostate cancer (PCa) incidence expressed as age standardised per
100 000 persons and percentage of contraceptive use in women aged 15–49, in individual
nations: worldwide (A), in Europe (B), and by continent (C).

As shown in figure 1A–C,
OC use was significantly
correlated with prostate
cancer incidence in the
individual nations
worldwide (figure 1A;
r=0.61, p<0.05), in Europe
(figure 1B; r=0.545,
p<0.05), and by continent
(figure 1C; r=0.522,
p<0.05).
Margel D , Fleshner N E BMJ Open 2011;1:e000311
Psychology 302 Quantitative and Psychometric Methods
©2011 by British Medical Journal Publishing Group
3
Psychology 302 Quantitative and Psychometric Methods
4
Time to get real
Z scores assume that we know the standard
deviation of the population. Which is
usually not the case.
 Improve accuracy and power by using Tdistributions for small samples

Psychology 302 Quantitative and Psychometric Methods
5
Music Trivia
Psychology 302 Quantitative and Psychometric Methods
6
Music Trivia
Psychology 302 Quantitative and Psychometric Methods
7
Hypothesis test for music trivia data
Psychology 302 Quantitative and Psychometric Methods
8
t distribution
Table C
 There is a different t distribution for each
sample size.
 t same formula as Z but uses a different
table of values
 Degrees of freedom determined by sample
size tells which t distribution to use.

Psychology 302 Quantitative and Psychometric Methods
9
t distributions
similar in shape to the normal curve
 the spread is greater because using s to
estimate the pop standard deviation
introduces more variation.
 As the degrees of freedom increase the
curve approaches the normal curve.
 Table c when n= 1000 T is nearly equal to Z

Psychology 302 Quantitative and Psychometric Methods
10
Estimating



One sample t-statistic
standard deviation is
estimated from the
data
standard error of the
statistic
M 
t
S/ N
Psychology 302 Quantitative and Psychometric Methods
11
T Distributions
Different for different sample sizes
 Select appropriate distribution by
determining degrees of freedom (n-1)
 Critical value is different for different
sample sizes.
 Critical value similar to Z in large samples

Psychology 302 Quantitative and Psychometric Methods
12
The t Distributions
Psychology 302 Quantitative and Psychometric Methods
13
Using Table B.2

Table B.2 on page
633 gives critical
values having upper
tail probability p.
Psychology 302 Quantitative and Psychometric Methods
14
One-Sample t Confidence Interval
Take an SRS of size n from a population with unknown
mean  and unknown standard deviation s. A level C
confidence interval for  is:
M t

s
n
where t* is the critical value for confidence level C
from the t density curve with n – 1 degrees of freedom.
Psychology 302 Quantitative and Psychometric Methods
15
Confidence intervals with
t distribution



Calculation similar to
using Z.
Substitute the sample
standard deviation for
the population
deviation
Look up the critical
value in table B.2
M t

s
n
Psychology 302 Quantitative and Psychometric Methods
16
Excel

User friendly
 manipulate
data
 make charts
 limited data
analysis
Psychology 302 Quantitative and Psychometric Methods
17
SPSS

Powerful statistical
package
Psychology 302 Quantitative and Psychometric Methods
18
T-test to two sample Data

Compare urban and
rural nursing homes
for patient days.
Psychology 302 Quantitative and Psychometric Methods
19
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
µ < 0
µ > 0
Psychology 302 Quantitative and Psychometric Methods
20
Nursing home data
t-Test: Two-Sample Assuming Unequal Variances
Non-rural
Rural
Mean Total Days
322.1111 257.9706
Variance
9031.634 16449.97
Observations
18
34
Hypothesized Mean Difference
0
df
44
t Stat
2.043086
P(T<=t) one-tail
0.023531
t Critical one-tail
1.68023
P(T<=t) two-tail
0.047062
t Critical two-tail
2.015367
Psychology 302 Quantitative and Psychometric Methods
21
SPSS output
Group Statistics
Total Days
Location2
1
2
N
Mean
322.11
257.97
18
34
Std. Deviation
95.035
128.257
Std. Error
Mean
22.400
21.996
Independent Samples Test
Levene's Test for
Equality of Variances
F
Total Days
Equal variances
assumed
Equal variances
not assumed
.446
Sig.
.507
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.865
50
.068
64.141
34.401
-4.955
133.236
2.043
44.349
.047
64.141
31.394
.884
127.397
Psychology 302 Quantitative and Psychometric Methods
22
T-test for Paired data


Women in the
workforce
Alternative hypothesis
there is some change
direction not assumed
Psychology 302 Quantitative and Psychometric Methods
23
Paired data
City
Year_68 Year_72
N.Y.
0.42
0.45
L.A.
0.50
0.50
Chicago
0.52
0.52
Philadelphia
0.45
0.45
Detroit
0.43
0.46
San Francisco
0.55
0.55
Boston
0.45
0.60
Pitt.
0.34
0.49
St. Louis
0.45
0.35
Connecticut
0.54
0.55
Wash., D.C.
0.42
0.52
Cinn.
0.51
0.53
Baltimore
0.49
0.57
Newark
0.54
0.53
Minn/St. Paul
0.50
0.59
Buffalo
0.58
0.64
Houston
0.49
0.50
Patterson
0.56
0.57
Dallas
0.63
0.64
Diff
0.03
0.00
0.00
0.00
0.03
0.00
0.15
0.15
-0.10
0.01
0.10
0.02
0.08
-0.01
0.09
0.06
0.01
0.01
0.01
Psychology 302 Quantitative and Psychometric Methods
24
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
µ < 0
µ > 0
City
Year_68 Year_72
N.Y.
0.42
0.45
L.A.
0.50
0.50
Chicago
0.52
0.52
Philadelphia
0.45
0.45
Detroit
0.43
0.46
San Francisco
0.55
0.55
Boston
0.45
0.60
Pitt.
0.34
0.49
St. Louis
0.45
0.35
Connecticut
0.54
0.55
Wash., D.C.
0.42
0.52
Cinn.
0.51
0.53
Baltimore
0.49
0.57
Newark
0.54
0.53
Minn/St. Paul
0.50
0.59
Buffalo
0.58
0.64
Houston
0.49
0.50
Patterson
0.56
0.57
Dallas
0.63
0.64
Psychology 302 Quantitative and Psychometric Methods
Diff
0.03
0.00
0.00
0.00
0.03
0.00
0.15
0.15
-0.10
0.01
0.10
0.02
0.08
-0.01
0.09
0.06
0.01
0.01
0.01
25
Excel Output
Psychology 302 Quantitative and Psychometric Methods
26
SPSS output
Paired Samples Statistics
Pair
1
Year_68
Year_72
Mean
.4932
.5268
N
19
19
Std. Deviation
.06799
.07079
Std. Error
Mean
.01560
.01624
Paired Samples Test
Paired Differences
Pair 1 Year_68 - Year_72
Std. Error
Mean Std. Deviation Mean
-.03368
.05974
.01371
95% Confidence
Interval of the
Difference
Lower
Upper
-.06248
-.00489
t
-2.458
Psychology 302 Quantitative and Psychometric Methods
df
Sig. (2-tailed)
18
.024
27
Two sample versus matched pairs
Cases or subjects in one sample have no
connection to or influence of cases or
subjects in the other sample.
 Sampling distribution of the differences of
means.

Psychology 302 Quantitative and Psychometric Methods
28
One-sample t-test Privitera pg. 272

Do rats spend more
time in one side of
cage?
Rat
minutes
Buzz
7
Snuffy
5
Mikey
8
Rough
6
Sintra
8
Perry
7
Whitey
9
Happy Jack
10
Dixie
3
Pinky
7
Mitzi
6
Buck
9
Psychology 302 Quantitative and Psychometric Methods
29
Psychology 302 Quantitative and Psychometric Methods
30
Group Statistics
Groups
Rating
N
Mean
Std. Deviation
Std. Error Mean
Humorous
5
6.00
1.581
.707
Not Humorous
5
3.00
1.581
.707
Independent Samples Test
Levene's Test for Equality of
Variances
t-test for Equality of Means
95% Confidence Interval of the
Difference
Std. Error
F
Rating
Equal variances assumed
Equal variances not
Sig.
.000
t
1.000
df
Sig. (2-tailed)
Mean Difference
Difference
Lower
Upper
3.000
8
.017
3.000
1.000
.694
5.306
3.000
8.000
.017
3.000
1.000
.694
5.306
assumed
Psychology 302 Quantitative and Psychometric Methods
31
Healing of Skin Wounds

How long does it
take wounds to heal
in a newt? Create a
95% confidence
interval.
Psychology 302 Quantitative and Psychometric Methods
32
n=18
 df = n-1 = 17

Psychology 302 Quantitative and Psychometric Methods
33
Confidence Intervals with t
Psychology 302 Quantitative and Psychometric Methods
34
SPSS output
One-Sample Statistics
N
Rate
18
Mean
25.67
Std. Deviation
8.324
Std. Error
Mean
1.962
One-Sample Test
Test Value = 0
Rate
t
13.081
df
17
Sig. (2-tailed)
.000
Mean
Difference
25.667
95% Confidenc e
Interval of the
Difference
Lower
Upper
21.53
29.81
Psychology 302 Quantitative and Psychometric Methods
35
Hypothesis test with one sample



hypothesis the same as
with Z
formula similar
critical value obtained
from table C, need
sample size.
M 
t
s/ n
Psychology 302 Quantitative and Psychometric Methods
36
Single Sample T-test

Do data show a
change of
sweetness?
Psychology 302 Quantitative and Psychometric Methods
37
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
Psychology 302 Quantitative and Psychometric Methods
38
SPSS output one-sample, one-tail test
One-Sample Statistics
N
Loss
Mean
1.0200
10
Std. Deviation
1.19610
Std. Error
Mean
.37824
One-Sample Test
Test Value = 0
Loss
t
2.697
df
9
Sig. (2-tailed)
.025
Mean
Difference
1.02000
95% Confidence
Interval of the
Difference
Lower
Upper
.1644
1.8756
Psychology 302 Quantitative and Psychometric Methods
39
Ancient Air 17.10 page 452

Do these data show
a change in
Nitrogen from the
present 78.1%
Psychology 302 Quantitative and Psychometric Methods
40
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
µ < 0
µ > 0
Psychology 302 Quantitative and Psychometric Methods
41
SPSS Output
One-Sample Statistics
N
PctNitrogen
9
Mean
59.5889
Std. Deviation
6.25529
Std. Error
Mean
2.08510
One-Sample Test
Test Value = 78.1
PctNitrogen
t
-8.878
df
8
Sig. (2-tailed)
.000
Mean
Difference
-18.51111
95% Confidence
Interval of the
Difference
Lower
Upper
-23.3194 -13.7029
Psychology 302 Quantitative and Psychometric Methods
42
Do male snake encounters last longer in the presence of a
female. Six males were tested in the presence of a female
and again in the absence of a female. Whether each male
was tested first with or without a female was randomly
determined. The results in interaction time (min.) are as
follows
Psychology 302 Quantitative and Psychometric Methods
43
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
µ < 0
µ > 0
Psychology 302 Quantitative and Psychometric Methods
44
Excel Output, 1-tail matched pairs
Psychology 302 Quantitative and Psychometric Methods
45
SPSS output
Paired Samples Statistics
Pair
1
Mean
24.00
60.33
wo female
with female
N
6
6
Std. Deviation
29.100
19.694
Std. Error
Mean
11.880
8.040
Paired Samples Test
Paired Differences
Pair 1 wo female - with female
Std. Error
Mean Std. Deviation Mean
-36.333
19.044
7.775
95% Confidence
Interval of the
Difference
Lower
Upper
-56.319
-16.348
t
-4.673
Psychology 302 Quantitative and Psychometric Methods
df
Sig. (2-tailed)
5
.005
46
Brain responds to sound pg 456

Do monkey cells
respond more strongly
to monkey calls that
pure tones?
Psychology 302 Quantitative and Psychometric Methods
47
Analyze Data


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
µ < 0
µ > 0
Psychology 302 Quantitative and Psychometric Methods
48
Excel Output
Psychology 302 Quantitative and Psychometric Methods
49
SPSS output
Paired Samples Statistics
Pair
1
Tone
Call
Mean
106.1892
176.5676
N
37
37
Std. Deviation
91.76354
111.84924
Std. Error
Mean
15.08583
18.38790
Paired Samples Test
Paired Differences
95% Confidence
Interval of the
Difference
Std. Error
Mean
Std. Deviation
Mean
Lower
Upper
Pair 1 Tone - Call -70.37838
88.44658 14.54053 -99.86794 -40.88882
t
-4.840
Psychology 302 Quantitative and Psychometric Methods
df
Sig. (2-tailed)
36
.000
50
Which has higher blood pressure?
Psychology 302 Quantitative and Psychometric Methods
51
Excel Output
Two tail, independent samples
Psychology 302 Quantitative and Psychometric Methods
52
SPSS output
Group Statistics
BP
Type
1
2
N
16
13
Mean
139.19
119.54
Std. Deviation
20.624
8.273
Std. Error
Mean
5.156
2.294
Independent Samples Test
Levene's Test for
Equality of Variances
F
BP
Equal variances
as sumed
Equal variances
not ass umed
Sig.
5.310
.029
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.222
27
.003
19.649
6.098
7.137
32.162
3.482
20.523
.002
19.649
5.644
7.896
31.402
Psychology 302 Quantitative and Psychometric Methods
53
Inference for the mean of a
population. Assumptions.
Data come from a simple random sample
 Observations from the population are
normally distributed
 Population parameters mean and standard
deviation are unknown.

Psychology 302 Quantitative and Psychometric Methods
54
Inference as a decision
We make a decision to accept Ho or Ha.
 Sometimes we are correct
 Sometimes we are wrong.

Psychology 302 Quantitative and Psychometric Methods
55
Type I error
If we reject Ho when in fact Ho is true
 If we decide it was not chance when in fact
it was chance.

Psychology 302 Quantitative and Psychometric Methods
56
Type II error
If we accept Ho when Ho is false.
 If we attribute a result to chance when it is
not chance.

Psychology 302 Quantitative and Psychometric Methods
57
A c t u a l S it u a t io n
D e c is io n
H o Tru e
H o F a ls e
R e je c t H o Ty p e I e rro r
c o rre c t
R e t a in H o c o rre c t
Ty p e II e rro r
Psychology 302 Quantitative and Psychometric Methods
58
Data Analysis Add-In
Excel Options
 Add-Ins (Manage Excel Add-ins)
 Go
 Check Analysis Tool Pack

Psychology 302 Quantitative and Psychometric Methods
59
18.45 Money thinking


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
 µ< 0
 µ> 0
t-Test: Two-Sample Assuming Unequal Variances
treatment
control
Mean
314.058824 186.117647
Variance
29856.3088 13945.8603
Observations
17
17
Hypothesized Mean Difference
0
df
28
t Stat
2.52050168
P(T<=t) one-tail
0.00884826
t Critical one-tail
1.70113091
P(T<=t) two-tail
0.01769653
t Critical two-tail
2.04840711
Psychology 302 Quantitative and Psychometric Methods
60
18.47 Math treatment


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
 µ< 0
 µ> 0
t-Test: Two-Sample Assuming Unequal Variances
Treatment
Control
Mean
11.4
8.25
Variance
10.04444444 13.6428571
Observations
10
8
Hypothesized Mean Difference
0
df
14
t Stat
1.914
P(T<=t) one-tail
0.038
t Critical one-tail
1.761310115
P(T<=t) two-tail
0.076347164
t Critical two-tail
2.144786681
Psychology 302 Quantitative and Psychometric Methods
61
18.46 Active Learning


Type of test
 Matched Pairs
 One-sample
 Independent Samples
One-tail or two
 Ho µ = 0
 Ha
 µ =/= 0
 µ< 0
 µ> 0
t-Test: Two-Sample Assuming Unequal Variances
Active
Passive
Mean
24.41666667
17.875
Variance
39.81884058 16.201087
Observations
24
24
Hypothesized Mean Difference
0
df
39
t Stat
4.281764333
P(T<=t) one-tail 0.00006
t Critical one-tail
1.684875122
P(T<=t) two-tail
0.000116879
t Critical two-tail
2.022690901
Psychology 302 Quantitative and Psychometric Methods
62
Psychology 302 Quantitative and Psychometric Methods
63
The End
Psychology 302 Quantitative and Psychometric Methods
64
Download