The One Sample t - Open Online Courses
Download
Report
Transcript The One Sample t - Open Online Courses
Testing Statistical Hypothesis
The One Sample t-Test
Heibatollah Baghi, and
Mastee Badii
1
Parametric and Nonparametric
Tests
• Parametric tests estimate at least one
parameter (in t-test it is population mean)
Usually for normal distributions and when the
dependent variable is interval/ratio
• Nonparametric tests do not test hypothesis
about specific population parameters
Distribution-free tests
Although appropriate for all levels of
measurement most frequently applied for
nominal or ordinal measures
2
Parametric and Nonparametric
Tests
• Nonparametric tests are easier to compute
and have less restrictive assumptions
• Parametric tests are much more powerful
(less likely to have type II error)
What is type two error?
This lecture focuses on
One sample t-test
which is a parametric test
3
Two Types of Error
• Alpha: α
– Probability of Type I Error
– P (Rejecting Ho when Ho is true)
– Predetermined Level of significance
• Beta: β
– Probability of Type II Error
– P (Failing to reject Ho when Ho is false)
4
Types of Error in Hypothesis Testing
Ho: Hand-washing has no effect on bacteria counts
True
True
(Accept Ho)
False
(Rejects Ho)
False
Type II error
Probability = b
Type I error
Probability = a
5
Types of Error in Hypothesis Testing
Ho: Hand-washing has no effect on bacteria counts
True
False
True
(Accept Ho)
Correct decision
Type II error
False
(Rejects Ho)
Type I error
Correct decision
Probability = 1- a
Probability = a
Probability = b
Probability = 1- b
6
Power & Confidence Level
• Power
– 1- β
– Probability of rejecting Ho when Ho is false
• Confidence level
– 1- α
– Probability of failing to reject Ho when Ho is
true
True
False
True
(Accept Ho)
Correct decision
Probability = 1- a
Type II error
Probability = b
False
(Rejects Ho)
Type I error
Probability = a
Correct decision
Probability = 1- b
7
Level of Significance
• α is a predetermined value by convention
usually 0.05
• α = 0.05 corresponds to the 95% confidence
level
• We are accepting the risk that out of 100
samples, we would reject a true null
hypothesis five times
8
Sampling Distribution Of Means
Population of IQ
scores, 10-year olds
µ=100
σ=16
n = 64
Sample
1
X 1 103.70
Sample
2
X 2 98.58
Sample 3
Etc
X 3 100.11
9
Sampling Distribution Of Means
• A sampling
distribution of
means is the
relative frequency
distribution of the
means of all
possible samples of
size n that could be
selected from the
population.
10
One Sample Test
• Compares mean of a sample to known
population mean
– Z-test
– T-test
This lecture focuses on
one sample t-test
11
The One Sample t – Test
Testing statistical hypothesis about µ
when σ is not known OR sample size is
small
12
An Example Problem
• Suppose that Dr. Tate learns from a national
survey that the average undergraduate student in
the United
States
spends 6.75 hours each week on
Population
mean
the Internet – composing and reading e-mail,
exploring the Web and constructing home pages.
Dr. Tate is interested in knowing how Internet use
among students at George Mason University
compares with this national average.
Small sample
• Dr. Tate randomly selects
a sample of only 10
students. Each student is asked to report the
number of hours he or she spends on the Internet
in a typical week during the academic year.
13
Population variance is unknown & estimated from sample
Steps in Test of Hypothesis
1. Determine the appropriate test
2. Establish the level of significance:α
3. Determine whether to use a one tail or two
tail test
4. Calculate the test statistic
5. Determine the degree of freedom
6. Compare computed test statistic against a
tabled value
14
1. Determine the appropriate test
If sample size is more than 30 use z-test
If sample size is less than 30 use t-test
Sample size of 10
15
2. Establish Level of Significance
• α is a predetermined value
• The convention
• α = .05
• α = .01
• α = .001
• In this example, assume α = 0.05
16
3. Determine Whether to Use a One
or Two Tailed Test
• H0 :µ = 6.75
• Ha :µ ≠ 6.75
17
4. Calculating Test Statistics
Number of
Student Hours(X) ( X
A
6
B
9
C
12
D
3
E
11
F
10
G
18
H
9
I
13
J
8
X
9 . 90
( X X )2
X ) ( X X )2
-3.9
-0.9
2.1
-6.9
1.1
0.1
8.1
-0.9
3.1
-1.9
15.21
0.81
4.41
47.61
1.21
0.01
56.61
0.81
9.61
3.61
Σ=148.90
18
4. Calculating Test Statistics
Number of
Student Hours(X) ( X
A
6
B
9
C
12
D
3
E
11
F
10
G
18
H
9
I
13
J
8
X
9 . 90
( X X )2
X ) ( X X )2
-3.9
-0.9
2.1
-6.9
1.1
0.1
8.1
-0.9
3.1
-1.9
15.21
0.81
Deviation
4.41
from sample
47.61
mean
1.21
0.01
56.61
0.81
9.61
3.61
19
Σ=148.90
4. Calculating Test Statistics
Number of
Student Hours(X) ( X
A
6
B
9
C
12
D
3
E
11
F
10
G
18
H
9
I
13
J
8
X 9.90
( X X )2
X ) ( X X )2
-3.9
15.21
-0.9
0.81 Squared
2.1
4.41 deviation
from
-6.9
47.61
sample
1.1
1.21
mean
0.1
0.01
8.1
56.61
-0.9
0.81
3.1
9.61
-1.9
3.61
20
Σ=148.90
4. Calculating Test Statistics
S
n 10
X 9.90
s 4.07
(X - X) 2
(n - 1)
148.90
4.07
9
X
tc
SX
s
4.07
Sx
1.29
3.16
n
(9.90 6.75)
tc
2.44
1.29
ta 2.262
2.44 2.262
21
4. Calculating Test Statistics
S
n 10
X 9.90
s 4.07
(X - X) 2
(n - 1)
148.90
4.07
9
X
tc
SX
s
4.07
Sx
1.29
3.16
n
(9.90 6.75)
tc
2.44
1.29
ta 2.262
2.44 2.262
22
4. Calculating Test Statistics
S
n 10
X 9.90
s 4.07
(X - X) 2
(n - 1)
148.90
4.07
9
X
tc
SX
Standard deviation
s
4.07
Sx
1.29
of sample means
3.16
n
(9.90 6.75)
tc
2.44
1.29
ta 2.262
2.44 2.262
23
4. Calculating Test Statistics
S
n 10
X 9.90
s 4.07
(X - X) 2
(n - 1)
148.90
4.07
9
X
tc
SX
4.07
s
1.29
Sx
3.16
n
(9.90 6.75)
2.44
tc
1.29
ta 2.262
2.44 2.262
Calculated t
24
5. Determine Degrees of
Freedom
• Degrees of freedom, df, is value indicating the
number of independent pieces of information a
sample can provide for purposes of statistical
inference.
• Df = Sample size – Number of parameters
estimated
• Df is n-1 for one sample test of mean because the
population variance is estimated from the sample
25
Degrees of Freedom
• Suppose you have a sample of three observations:
X
--------
2
(X X ) (X X )
---------------1
1
2
-1
1
5
+2
4
--------
------
------
X 3
Σ=0
6
2
26
Degrees of Freedom
S
(X - X) 2
(n - 1)
• Why n-1 and not n?
– Are these three deviations independent of one
another?
• No, if you know that two of the deviation scores are -1
and -1, the third deviation score gives you no new
independent information ---it has to be +2 for all three
to sum to 0.
27
Degrees of Freedom Continued
• For your sample scores, you have only
two independent pieces of information,
or degrees of freedom, on which to
base your estimates of S and S
x
28
S
(X - X)
(n - 1)
148.90
4.07
9
X
6.t Compare
the Computed Test
S
Statistics Against
4.07 a Tabled Value
c
X
Sx
3.16
• α = .05 n
(9.90 6.75)
t
c
• Df = n-1 =19.29
1.29
2.44
ta 2.262
2.44 2.262
• Therefore, reject H0
29
Decision Rule for t-Scores
If |tc| > |tα|
Reject H0
30
Decision Rule for P-values
If p value < α
Reject H0
Pvalue is one minus
probability of observing
the t-value calculated
from our sample
31
Example of Decision Rules
• In terms of t score:
|tc = 2.449| > |tα= 2.262|
Reject H0
• In terms of p-value:
If p value = .037 < α = .05 Reject H0
32
Constructing a Confidence Interval
for µ
Sample mean
Standard deviation of sample means
X
X tta
a SSxx
99..90
90 ((22..262
262)(
)(11..29
29)) 99..90
90 22..92
92
66..98
98..........
....................
....................
..............12
12..84
84
we
we are
are 95
95 %
% confident
confident that
that falls
falls in
in this
this interval.
interval.
33
Constructing a Confidence Interval
for µ for the Example
• Sample mean is 9.90
• Critical t value is 2.262
• Standard deviation of sample means is 1.29
X ta S
• 99.90
1.29
.90 +(22.262
.262)(1*.29
) 9.90 2.92
• 6The
estimated
.98..........
..........interval
............12goes
.84 from 6.98 to
12.84
x
we are 95 % confident that falls in this interval.
34
Distribution of Mean of Samples
In drawing samples
at random, the
probability is .95
that an interval
X constructed with the
rule
95%
CI = X + 1.96
will include
_
_
_
X
35
Sample Report of One Sample t-test in
Literature
One Sample t-test Testing Neutrality of
Attitudes Towards Infertility Alternatives
Mean
Standard
deviation
t-value
P value
In Vitro Fertilization
5.5
2
2.5
<.05
Artificial Insemination
5.25
2.25
1.11
NS
Adoption
4.5
1.8
2.78
<.01
Remaining Childless
3.4
1.7
9.41
<.001
Attitude Toward
df = 99
36
Testing Statistical Hypothesis
With SPSS
SPSS Output: One-Sample Statistics
N
Number of Hours
Std.
Deviation
Mean
10
9.90
4.067
Std. Error
Mean
1.286
One-Sample Test
Test Value = 6.75
95% Confidence Interval
of the Difference
df
Sig. (2-tailed)
Mean
Difference
tc
Number of Hours
Upper
Lower
2.449
9
.037
3.150
.24
6.06
37
Take Home Lesson
Procedures for Conducting &
Interpreting One Sample Mean Test
with Unknown Variance
38