SlideShare a Scribd company logo
1 of 31
The t-test
Inferences about Population Means
Questions
• What is the main use of the t-test?
• How is the distribution of t related to the unit
normal?
• When would we use a t-test instead of a z-
test? Why might we prefer one to the other?
• What are the chief varieties or forms of the t-
test?
• What is the standard error of the difference
between means? What are the factors that
influence its size?
More Questions
• Identify the appropriate to version of t
to use for a given design.
• Compute and interpret t-tests
appropriately.
• Given that
construct a rejection region. Draw a
picture to illustrate.
01
.
2
;
49
;
14
;
75
:
;
75
: )
48
,
05
(.
1
0 



 t
N
s
H
H y


Background
• The t-test is used to test hypotheses
about means when the population
variance is unknown (the usual case).
Closely related to z, the unit normal.
• Developed by Gossett for the quality
control of beer.
• Comes in 3 varieties:
• Single sample, independent samples,
and dependent samples.
What kind of t is it?
• Single sample t – we have only 1 group; want
to test against a hypothetical mean.
• Independent samples t – we have 2 means, 2
groups; no relation between groups, e.g.,
people randomly assigned to a single group.
• Dependent t – we have two means. Either
same people in both groups, or people are
related, e.g., husband-wife, left hand-right
hand, hospital patient and visitor.
Single-sample z test
• For large samples (N>100) can use z to
test hypotheses about means.
• Suppose
• Then
• If
M
M
est
X
z


.
)
( 

N
N
X
X
N
s
est X
M
1
)
(
.
2






200
;
5
;
10
:
;
10
: 1
0 


 N
s
H
H X


35
.
14
.
14
5
200
5
. 



N
s
est X
M

05
.
96
.
1
83
.
2
;
83
.
2
35
.
)
10
11
(
11 






 p
z
X
The t Distribution
We use t when the population variance is unknown (the
usual case) and sample size is small (N<100, the usual
case). If you use a stat package for testing hypotheses
about means, you will use t.
The t distribution is a short, fat relative of the normal. The shape of t depends on
its df. As N becomes infinitely large, t becomes normal.
Degrees of Freedom
For the t distribution, degrees of freedom are always a
simple function of the sample size, e.g., (N-1).
One way of explaining df is that if we know the total or
mean, and all but one score, the last (N-1) score is not free to
vary. It is fixed by the other scores. 4+3+2+X = 10. X=1.
Single-sample t-test
With a small sample size, we compute the same numbers
as we did for z, but we compare them to the t distribution
instead of the z distribution.
25
;
5
;
10
:
;
10
: 1
0 


 N
s
H
H X


1
25
5
. 


N
s
est X
M
 1
1
)
10
11
(
11 



 t
X
064
.
2
)
24
,
05
(. 
t 1<2.064, n.s.
Interval =
]
064
.
13
,
936
.
8
[
)
1
(
064
.
2
11
ˆ


 M
t
X 
Interval is about 9 to 13 and contains 10, so n.s.
(c.f. z=1.96)
Review
 How are the distributions of z and t related?
 Given that
construct a rejection region. Draw a picture
to illustrate.
01
.
2
;
49
;
14
;
75
:
;
75
: )
48
,
05
(.
1
0 



 t
N
s
H
H y


Difference Between Means (1)
• Most studies have at least 2 groups
(e.g., M vs. F, Exp vs. Control)
• If we want to know diff in population
means, best guess is diff in sample
means.
• Unbiased:
• Variance of the Difference:
• Standard Error:
2
2
2
1
2
1 )
var( M
M
y
y 
 


2
1
2
1
2
1 )
(
)
(
)
( 
 



 y
E
y
E
y
y
E
2
2
2
1 M
M
diff 

 

Difference Between Means (2)
• We can estimate the standard error of
the difference between means.
• For large samples, can use z
2
2
2
1 .
.
. M
M
diff est
est
est 

 

diff
est
X
X
diff
z 

 )
(
)
( 2
1
2
1 



3
;
100
;
12
2
;
100
;
10
0
:
;
0
:
2
2
2
1
1
1
2
1
1
2
1
0










SD
N
X
SD
N
X
H
H 



36
.
100
13
100
9
100
4
. 



diff
est 
05
.
;
56
.
5
36
.
2
36
.
0
)
12
10
(





 p
zdiff
Independent Samples t (1)
• Looks just like z:
• df=N1-1+N2-1=N1+N2-2
• If SDs are equal, estimate is:
diff
est
y
y
diff
t 

 )
(
)
( 2
1
2
1 













2
1
2
2
2
1
2
1
1
N
N
N
N
diff 



Pooled variance estimate is weighted average:
)]
2
/(
1
/[
]
)
1
(
)
1
[( 2
1
2
2
2
2
1
1
2





 N
N
s
N
s
N

Pooled Standard Error of the Difference (computed):





 






2
1
2
1
2
1
2
2
2
2
1
1
2
)
1
(
)
1
(
.
N
N
N
N
N
N
s
N
s
N
est diff

Independent Samples t (2)





 






2
1
2
1
2
1
2
2
2
2
1
1
2
)
1
(
)
1
(
.
N
N
N
N
N
N
s
N
s
N
est diff

diff
est
y
y
diff
t 

 )
(
)
( 2
1
2
1 



7
;
83
.
5
;
20
5
;
7
;
18
0
:
;
0
:
2
2
2
2
1
2
1
1
2
1
1
2
1
0










N
s
y
N
s
y
H
H 



47
.
1
35
12
2
7
5
)
83
.
5
(
6
)
7
(
4
. 










diff
est 
.
.
;
36
.
1
47
.
1
2
47
.
1
0
)
20
18
(
s
n
tdiff 






tcrit = t(.05,10)=2.23
Review
What is the standard error of the
difference between means? What are
the factors that influence its size?
Describe a design (what IV? What
DV?) where it makes sense to use the
independent samples t test.
Dependent t (1)
Observations come in pairs. Brother, sister, repeated measure.
)
,
cov(
2 2
1
2
2
2
1
2
y
y
M
M
diff 

 


Problem solved by finding diffs between pairs Di=yi1-yi2.
1
)
( 2
2




N
D
D
s i
D
N
s
est D
MD 

.
N
D
D i


)
(
MD
est
D
E
D
t

.
)
(

 df=N(pairs)-1
Dependent t (2)
Brother Sister
5 7
7 8
3 3
5

y 6

y
Diff
2 1
1 0
0 1
1

D
58
.
3
/
1
. 

MD
est 
72
.
1
58
.
1
.
)
(




MD
est
D
E
D
t

1
1
)
( 2





N
D
D
sD
2
)
( D
D 
Assumptions
• The t-test is based on assumptions of
normality and homogeneity of variance.
• You can test for both these (make sure
you learn the SAS methods).
• As long as the samples in each group
are large and nearly equal, the t-test is
robust, that is, still good, even tho
assumptions are not met.
Review
• Describe a design where it makes sense
to use a single-sample t.
• Describe a design where it makes sense
to use a dependent samples t.
Strength of Association (1)
• Scientific purpose is to predict or
explain variation.
• Our variable Y has some variance that
we would like to account for. There are
statistical indexes of how well our IV
accounts for variance in the DV. These
are measures of how strongly or closely
associated our Ivs and DVs are.
• Variance accounted for:
2
2
2
1
2
2
|
2
2
4
)
(
Y
Y
X
Y
Y











Strength of Association (2)
• How much of variance in Y is
associated with the IV? 2
2
2
1
2
2
|
2
2
4
)
(
Y
Y
X
Y
Y











6
4
2
0
-2
-4
0.4
0.3
0.2
0.1
0.0
Compare the 1st (left-most) curve with the curve in the
middle and the one on the right.
In each case, how
much of the variance
in Y is associated
with the IV, group
membership? More
in the second
comparison. As
mean diff gets big, so
does variance acct.
Association & Significance
• Power increases with association (effect
size) and sample size.
• Effect size:
• Significance = effect size X sample
size.
p
X
X
d 
/
)
( 2
1 










2
1
2
2
1
1
1
)
(
N
N
X
X
t
p

Increasing sample size does not increase effect size
(strength of association). It decreases the standard
error so power is greater, |t| is larger.








N
X
t
2
)
(


(independent
samples)
(single
sample)
N
d
t 
Estimating Power (1)
• If the null is false, the statistic is no
longer distributed as t, but rather as
noncentral t. This makes power
computation difficult.
• Howell introduces the noncentrality
parameter delta to use for estimating
power. For the one-sample t,
n
d

 Recall the relations between t
and d on the previous slide
Estimating Power (2)
• Suppose (Howell, p. 231) that we have
25 people, a sample mean of 105, and a
hypothesized mean and SD of 100 and
15, respectively. Then
33
.
3
/
1
15
100
105




d
38
.
65
.
1
25
33
.




power
n
d

Howell presents an appendix
where delta is related to
power. For power = .8, alpha
= .05, delta must be 2.80. To
solve for N, we compute:
91
.
71
48
.
8
33
.
8
.
2
; 2
2
2

















d
n
n
d


Estimating Power (3)
• Dependent t can be cast as a single
sample t using difference scores.
• Independent t. To use Howell’s
method, the result is n per group, so
double it. Suppose d = .5 (medium
effect) and n =25 per group.
77
.
1
5
.
12
5
.
2
25
50
.
2




n
d
 From Howell’s appendix, the
value of delta of 1.77 with
alpha = .05 results in power of
.43. For a power of .8, we
need delta = 2.80
72
.
62
5
.
8
.
2
2
2
2
2















d
n

Need 63 per group.
SAS Proc Power – single
sample example
proc power;
onesamplemeans test=t
nullmean = 100
mean = 105
stddev = 15
power = .8
ntotal = . ;
run;
The POWER Procedure
One-sample t Test for Mean
Fixed Scenario Elements
Distribution Normal
Method Exact
Null Mean 100
Mean 105
Standard Deviation 15
Nominal Power 0.8
Number of Sides 2
Alpha 0.05
Computed N Total
Actual N
Power Total
0.802 73
2 sample t Power
;
proc power;
twosamplemeans
meandiff= .5
stddev=1
power=0.8
ntotal=.;
run;
Two-sample t Test for Mean Difference
Fixed Scenario Elements
Distribution Normal
Method Exact
Mean Difference 0.5
Standard Deviation 1
Nominal Power 0.8
Number of Sides 2
Null Difference 0
Alpha 0.05
Group 1 Weight 1
Group 2 Weight 1
Computed N Total
Actual N
Power Total
0.801 128
Calculate sample size
2 sample t Power
• proc power;
• twosamplemeans
• meandiff = 5 [assumed
difference]
• stddev =10 [assumed SD]
• sides = 1 [1 tail]
• ntotal = 50 [25 per
group]
• power = .; *[tell me!];
• run;
The POWER Procedure
Two-Sample t Test for Mean Difference
Fixed Scenario Elements
Distribution Normal
Method Exact
Number of Sides 1
Mean Difference 5
Standard Deviation 10
Total Sample Size 50
Null Difference 0
Alpha 0.05
Group 1 Weight 1
Group 2 Weight 1
Computed Power
Power
0.539
Typical Power in Psych
• Average effect size is about d=.40.
• Consider power for effect sizes between
.3 and .6. What kind of sample size do
we need for power of .8?
proc power;
twosamplemeans
meandiff= .3 to .6 by .1
stddev=1
power=.8
ntotal=.;
plot x= power min = .5 max=.95;
run;
Two-sample t Test for 1
Computed N Total
Mean Actual N
Index Diff Power Total
1 0.3 0.801 352
2 0.4 0.804 200
3 0.5 0.801 128
4 0.6 0.804 90
Typical studies are underpowered.
Power Curves
0.5 0.6 0.7 0.8 0.9 1.0
Power
0
100
200
300
400
500
600
Total
Sample
Size
Mean Diff 0.3
0.4
0.5
0.6
Why a whopper of an IV is helpful.
Review
• About how many people total will you
need for power of .8, alpha is .05 (two
tails), and an effect size of .3?
• You can only afford 40 people per
group, and based on the literature, you
estimate the group means to be 50 and
60 with a standard deviation within
groups of 20. What is your power
estimate?

More Related Content

Similar to The T-test

jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhg
jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhgjhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhg
jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhgUMAIRASHFAQ20
 
The t Test for Two Independent Samples
The t Test for Two Independent SamplesThe t Test for Two Independent Samples
The t Test for Two Independent Samplesjasondroesch
 
Lesson06_static11
Lesson06_static11Lesson06_static11
Lesson06_static11thangv
 
Lesson06_new
Lesson06_newLesson06_new
Lesson06_newshengvn
 
Application of Statistical and mathematical equations in Chemistry Part 2
Application of Statistical and mathematical equations in Chemistry Part 2Application of Statistical and mathematical equations in Chemistry Part 2
Application of Statistical and mathematical equations in Chemistry Part 2Awad Albalwi
 
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdf
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdfUnit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdf
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdfRavinandan A P
 
Determination of sample size in scientific research.pptx
Determination of sample size in scientific research.pptxDetermination of sample size in scientific research.pptx
Determination of sample size in scientific research.pptxSam Edeson
 
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-test
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-testHypothesis Test _Two-sample t-test, Z-test, Proportion Z-test
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-testRavindra Nath Shukla
 
Sampling distribution.pptx
Sampling distribution.pptxSampling distribution.pptx
Sampling distribution.pptxssusera0e0e9
 
Z and t_tests
Z and t_testsZ and t_tests
Z and t_testseducation
 
Chapter one on sampling distributions.ppt
Chapter one on sampling distributions.pptChapter one on sampling distributions.ppt
Chapter one on sampling distributions.pptFekaduAman
 

Similar to The T-test (20)

jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhg
jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhgjhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhg
jhghgjhgjhgjhfhcgjfjhvjhjgjkggjhgjhgjhfjgjgfgfhgfhg
 
The t Test for Two Independent Samples
The t Test for Two Independent SamplesThe t Test for Two Independent Samples
The t Test for Two Independent Samples
 
T test statistics
T test statisticsT test statistics
T test statistics
 
Lesson06_static11
Lesson06_static11Lesson06_static11
Lesson06_static11
 
Lesson06_new
Lesson06_newLesson06_new
Lesson06_new
 
Medical statistics2
Medical statistics2Medical statistics2
Medical statistics2
 
the t test
the t testthe t test
the t test
 
Application of Statistical and mathematical equations in Chemistry Part 2
Application of Statistical and mathematical equations in Chemistry Part 2Application of Statistical and mathematical equations in Chemistry Part 2
Application of Statistical and mathematical equations in Chemistry Part 2
 
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdf
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdfUnit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdf
Unit-I Measures of Dispersion- Biostatistics - Ravinandan A P.pdf
 
Determination of sample size in scientific research.pptx
Determination of sample size in scientific research.pptxDetermination of sample size in scientific research.pptx
Determination of sample size in scientific research.pptx
 
Data analysis
Data analysisData analysis
Data analysis
 
Stat2013
Stat2013Stat2013
Stat2013
 
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-test
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-testHypothesis Test _Two-sample t-test, Z-test, Proportion Z-test
Hypothesis Test _Two-sample t-test, Z-test, Proportion Z-test
 
Sampling distribution.pptx
Sampling distribution.pptxSampling distribution.pptx
Sampling distribution.pptx
 
classmar16.ppt
classmar16.pptclassmar16.ppt
classmar16.ppt
 
classmar16.ppt
classmar16.pptclassmar16.ppt
classmar16.ppt
 
Chapter 11 Psrm
Chapter 11 PsrmChapter 11 Psrm
Chapter 11 Psrm
 
Two Means, Independent Samples
Two Means, Independent SamplesTwo Means, Independent Samples
Two Means, Independent Samples
 
Z and t_tests
Z and t_testsZ and t_tests
Z and t_tests
 
Chapter one on sampling distributions.ppt
Chapter one on sampling distributions.pptChapter one on sampling distributions.ppt
Chapter one on sampling distributions.ppt
 

More from ZyrenMisaki

Biodiversity.pdf
Biodiversity.pdfBiodiversity.pdf
Biodiversity.pdfZyrenMisaki
 
I Will Face My Giant.pptx
I Will Face My Giant.pptxI Will Face My Giant.pptx
I Will Face My Giant.pptxZyrenMisaki
 
Statistical Tools
Statistical ToolsStatistical Tools
Statistical ToolsZyrenMisaki
 
The Information Age
The Information AgeThe Information Age
The Information AgeZyrenMisaki
 
Module 1 Powerpoint 2.pptx
Module 1 Powerpoint 2.pptxModule 1 Powerpoint 2.pptx
Module 1 Powerpoint 2.pptxZyrenMisaki
 

More from ZyrenMisaki (8)

Biodiversity.pdf
Biodiversity.pdfBiodiversity.pdf
Biodiversity.pdf
 
Logic 1
Logic 1Logic 1
Logic 1
 
Valid Arguments
Valid ArgumentsValid Arguments
Valid Arguments
 
I Will Face My Giant.pptx
I Will Face My Giant.pptxI Will Face My Giant.pptx
I Will Face My Giant.pptx
 
Statistical Tools
Statistical ToolsStatistical Tools
Statistical Tools
 
The Information Age
The Information AgeThe Information Age
The Information Age
 
STS Chapter 2
STS Chapter 2STS Chapter 2
STS Chapter 2
 
Module 1 Powerpoint 2.pptx
Module 1 Powerpoint 2.pptxModule 1 Powerpoint 2.pptx
Module 1 Powerpoint 2.pptx
 

Recently uploaded

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppCeline George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 

Recently uploaded (20)

Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
URLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website AppURLs and Routing in the Odoo 17 Website App
URLs and Routing in the Odoo 17 Website App
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 

The T-test

  • 1. The t-test Inferences about Population Means
  • 2. Questions • What is the main use of the t-test? • How is the distribution of t related to the unit normal? • When would we use a t-test instead of a z- test? Why might we prefer one to the other? • What are the chief varieties or forms of the t- test? • What is the standard error of the difference between means? What are the factors that influence its size?
  • 3. More Questions • Identify the appropriate to version of t to use for a given design. • Compute and interpret t-tests appropriately. • Given that construct a rejection region. Draw a picture to illustrate. 01 . 2 ; 49 ; 14 ; 75 : ; 75 : ) 48 , 05 (. 1 0      t N s H H y  
  • 4. Background • The t-test is used to test hypotheses about means when the population variance is unknown (the usual case). Closely related to z, the unit normal. • Developed by Gossett for the quality control of beer. • Comes in 3 varieties: • Single sample, independent samples, and dependent samples.
  • 5. What kind of t is it? • Single sample t – we have only 1 group; want to test against a hypothetical mean. • Independent samples t – we have 2 means, 2 groups; no relation between groups, e.g., people randomly assigned to a single group. • Dependent t – we have two means. Either same people in both groups, or people are related, e.g., husband-wife, left hand-right hand, hospital patient and visitor.
  • 6. Single-sample z test • For large samples (N>100) can use z to test hypotheses about means. • Suppose • Then • If M M est X z   . ) (   N N X X N s est X M 1 ) ( . 2       200 ; 5 ; 10 : ; 10 : 1 0     N s H H X   35 . 14 . 14 5 200 5 .     N s est X M  05 . 96 . 1 83 . 2 ; 83 . 2 35 . ) 10 11 ( 11         p z X
  • 7. The t Distribution We use t when the population variance is unknown (the usual case) and sample size is small (N<100, the usual case). If you use a stat package for testing hypotheses about means, you will use t. The t distribution is a short, fat relative of the normal. The shape of t depends on its df. As N becomes infinitely large, t becomes normal.
  • 8. Degrees of Freedom For the t distribution, degrees of freedom are always a simple function of the sample size, e.g., (N-1). One way of explaining df is that if we know the total or mean, and all but one score, the last (N-1) score is not free to vary. It is fixed by the other scores. 4+3+2+X = 10. X=1.
  • 9. Single-sample t-test With a small sample size, we compute the same numbers as we did for z, but we compare them to the t distribution instead of the z distribution. 25 ; 5 ; 10 : ; 10 : 1 0     N s H H X   1 25 5 .    N s est X M  1 1 ) 10 11 ( 11      t X 064 . 2 ) 24 , 05 (.  t 1<2.064, n.s. Interval = ] 064 . 13 , 936 . 8 [ ) 1 ( 064 . 2 11 ˆ    M t X  Interval is about 9 to 13 and contains 10, so n.s. (c.f. z=1.96)
  • 10. Review  How are the distributions of z and t related?  Given that construct a rejection region. Draw a picture to illustrate. 01 . 2 ; 49 ; 14 ; 75 : ; 75 : ) 48 , 05 (. 1 0      t N s H H y  
  • 11. Difference Between Means (1) • Most studies have at least 2 groups (e.g., M vs. F, Exp vs. Control) • If we want to know diff in population means, best guess is diff in sample means. • Unbiased: • Variance of the Difference: • Standard Error: 2 2 2 1 2 1 ) var( M M y y      2 1 2 1 2 1 ) ( ) ( ) (        y E y E y y E 2 2 2 1 M M diff     
  • 12. Difference Between Means (2) • We can estimate the standard error of the difference between means. • For large samples, can use z 2 2 2 1 . . . M M diff est est est      diff est X X diff z    ) ( ) ( 2 1 2 1     3 ; 100 ; 12 2 ; 100 ; 10 0 : ; 0 : 2 2 2 1 1 1 2 1 1 2 1 0           SD N X SD N X H H     36 . 100 13 100 9 100 4 .     diff est  05 . ; 56 . 5 36 . 2 36 . 0 ) 12 10 (       p zdiff
  • 13. Independent Samples t (1) • Looks just like z: • df=N1-1+N2-1=N1+N2-2 • If SDs are equal, estimate is: diff est y y diff t    ) ( ) ( 2 1 2 1               2 1 2 2 2 1 2 1 1 N N N N diff     Pooled variance estimate is weighted average: )] 2 /( 1 /[ ] ) 1 ( ) 1 [( 2 1 2 2 2 2 1 1 2       N N s N s N  Pooled Standard Error of the Difference (computed):              2 1 2 1 2 1 2 2 2 2 1 1 2 ) 1 ( ) 1 ( . N N N N N N s N s N est diff 
  • 14. Independent Samples t (2)              2 1 2 1 2 1 2 2 2 2 1 1 2 ) 1 ( ) 1 ( . N N N N N N s N s N est diff  diff est y y diff t    ) ( ) ( 2 1 2 1     7 ; 83 . 5 ; 20 5 ; 7 ; 18 0 : ; 0 : 2 2 2 2 1 2 1 1 2 1 1 2 1 0           N s y N s y H H     47 . 1 35 12 2 7 5 ) 83 . 5 ( 6 ) 7 ( 4 .            diff est  . . ; 36 . 1 47 . 1 2 47 . 1 0 ) 20 18 ( s n tdiff        tcrit = t(.05,10)=2.23
  • 15. Review What is the standard error of the difference between means? What are the factors that influence its size? Describe a design (what IV? What DV?) where it makes sense to use the independent samples t test.
  • 16. Dependent t (1) Observations come in pairs. Brother, sister, repeated measure. ) , cov( 2 2 1 2 2 2 1 2 y y M M diff       Problem solved by finding diffs between pairs Di=yi1-yi2. 1 ) ( 2 2     N D D s i D N s est D MD   . N D D i   ) ( MD est D E D t  . ) (   df=N(pairs)-1
  • 17. Dependent t (2) Brother Sister 5 7 7 8 3 3 5  y 6  y Diff 2 1 1 0 0 1 1  D 58 . 3 / 1 .   MD est  72 . 1 58 . 1 . ) (     MD est D E D t  1 1 ) ( 2      N D D sD 2 ) ( D D 
  • 18. Assumptions • The t-test is based on assumptions of normality and homogeneity of variance. • You can test for both these (make sure you learn the SAS methods). • As long as the samples in each group are large and nearly equal, the t-test is robust, that is, still good, even tho assumptions are not met.
  • 19. Review • Describe a design where it makes sense to use a single-sample t. • Describe a design where it makes sense to use a dependent samples t.
  • 20. Strength of Association (1) • Scientific purpose is to predict or explain variation. • Our variable Y has some variance that we would like to account for. There are statistical indexes of how well our IV accounts for variance in the DV. These are measures of how strongly or closely associated our Ivs and DVs are. • Variance accounted for: 2 2 2 1 2 2 | 2 2 4 ) ( Y Y X Y Y           
  • 21. Strength of Association (2) • How much of variance in Y is associated with the IV? 2 2 2 1 2 2 | 2 2 4 ) ( Y Y X Y Y            6 4 2 0 -2 -4 0.4 0.3 0.2 0.1 0.0 Compare the 1st (left-most) curve with the curve in the middle and the one on the right. In each case, how much of the variance in Y is associated with the IV, group membership? More in the second comparison. As mean diff gets big, so does variance acct.
  • 22. Association & Significance • Power increases with association (effect size) and sample size. • Effect size: • Significance = effect size X sample size. p X X d  / ) ( 2 1            2 1 2 2 1 1 1 ) ( N N X X t p  Increasing sample size does not increase effect size (strength of association). It decreases the standard error so power is greater, |t| is larger.         N X t 2 ) (   (independent samples) (single sample) N d t 
  • 23. Estimating Power (1) • If the null is false, the statistic is no longer distributed as t, but rather as noncentral t. This makes power computation difficult. • Howell introduces the noncentrality parameter delta to use for estimating power. For the one-sample t, n d   Recall the relations between t and d on the previous slide
  • 24. Estimating Power (2) • Suppose (Howell, p. 231) that we have 25 people, a sample mean of 105, and a hypothesized mean and SD of 100 and 15, respectively. Then 33 . 3 / 1 15 100 105     d 38 . 65 . 1 25 33 .     power n d  Howell presents an appendix where delta is related to power. For power = .8, alpha = .05, delta must be 2.80. To solve for N, we compute: 91 . 71 48 . 8 33 . 8 . 2 ; 2 2 2                  d n n d  
  • 25. Estimating Power (3) • Dependent t can be cast as a single sample t using difference scores. • Independent t. To use Howell’s method, the result is n per group, so double it. Suppose d = .5 (medium effect) and n =25 per group. 77 . 1 5 . 12 5 . 2 25 50 . 2     n d  From Howell’s appendix, the value of delta of 1.77 with alpha = .05 results in power of .43. For a power of .8, we need delta = 2.80 72 . 62 5 . 8 . 2 2 2 2 2                d n  Need 63 per group.
  • 26. SAS Proc Power – single sample example proc power; onesamplemeans test=t nullmean = 100 mean = 105 stddev = 15 power = .8 ntotal = . ; run; The POWER Procedure One-sample t Test for Mean Fixed Scenario Elements Distribution Normal Method Exact Null Mean 100 Mean 105 Standard Deviation 15 Nominal Power 0.8 Number of Sides 2 Alpha 0.05 Computed N Total Actual N Power Total 0.802 73
  • 27. 2 sample t Power ; proc power; twosamplemeans meandiff= .5 stddev=1 power=0.8 ntotal=.; run; Two-sample t Test for Mean Difference Fixed Scenario Elements Distribution Normal Method Exact Mean Difference 0.5 Standard Deviation 1 Nominal Power 0.8 Number of Sides 2 Null Difference 0 Alpha 0.05 Group 1 Weight 1 Group 2 Weight 1 Computed N Total Actual N Power Total 0.801 128 Calculate sample size
  • 28. 2 sample t Power • proc power; • twosamplemeans • meandiff = 5 [assumed difference] • stddev =10 [assumed SD] • sides = 1 [1 tail] • ntotal = 50 [25 per group] • power = .; *[tell me!]; • run; The POWER Procedure Two-Sample t Test for Mean Difference Fixed Scenario Elements Distribution Normal Method Exact Number of Sides 1 Mean Difference 5 Standard Deviation 10 Total Sample Size 50 Null Difference 0 Alpha 0.05 Group 1 Weight 1 Group 2 Weight 1 Computed Power Power 0.539
  • 29. Typical Power in Psych • Average effect size is about d=.40. • Consider power for effect sizes between .3 and .6. What kind of sample size do we need for power of .8? proc power; twosamplemeans meandiff= .3 to .6 by .1 stddev=1 power=.8 ntotal=.; plot x= power min = .5 max=.95; run; Two-sample t Test for 1 Computed N Total Mean Actual N Index Diff Power Total 1 0.3 0.801 352 2 0.4 0.804 200 3 0.5 0.801 128 4 0.6 0.804 90 Typical studies are underpowered.
  • 30. Power Curves 0.5 0.6 0.7 0.8 0.9 1.0 Power 0 100 200 300 400 500 600 Total Sample Size Mean Diff 0.3 0.4 0.5 0.6 Why a whopper of an IV is helpful.
  • 31. Review • About how many people total will you need for power of .8, alpha is .05 (two tails), and an effect size of .3? • You can only afford 40 people per group, and based on the literature, you estimate the group means to be 50 and 60 with a standard deviation within groups of 20. What is your power estimate?