Professional Documents
Culture Documents
Week6-One-Sample - T Tests
Week6-One-Sample - T Tests
x 0 x 0 x 0
z
x s
n n
Comments
• The sampling distribution of this statistic is the
standard Normal distribution
• The replacement of by s leaves this
distribution unchanged only if the sample size
n is large.
For small sample sizes:
The sampling distribution of
x 0
t
s
n
is called “students” t distribution with n –1
degrees of freedom
Properties of Student’s t
distribution
• Similar to Standard normal distribution
– Symmetric
– unimodal
– Centred at zero
• Larger spread about zero.
– The reason for this is the increased variability introduced
by replacing by s.
• As the sample size increases (degrees of freedom
increases) the t distribution approaches the standard
normal distribution
0.4
0.3
0.2
0.1
-4 -2 2 4
t distribution
standard normal distribution
The Situation
• Let x1, x2, x3 , … , xn denote a sample from a normal
population with mean and standard deviation .
Both and are unknown.
• Let
n
x i
x i 1
the sample mean
n
n
x x
2
i
s i 1
the sample standard deviation
n 1
• we want to test if the mean, , is equal to some given
value 0.
The Test Statistic
x 0
t
s
n
The sampling distribution of the test
statistic is the t distribution with n-1
degrees of freedom
The Alternative The Critical Region
Hypothesis HA
H A : 0 t t / 2 or t t / 2
H A : 0 t t
H A : 0 t t
or /2
0
t
t / 2 or t
Critical values for the t-distribution are
provided in tables. A link to these tables are
given with today’s lecture
Look up
Look up df
Note: the values
tabled for df = ∞
are the same
values for the
standard normal
distribution, z
…
Example
• Let x1, x2, x3 , x4, x5, x6 denote weight loss
from a new diet for n = 6 cases.
• Assume that x1, x2, x3 , x4, x5, x6 is a sample
from a normal population with mean and
standard deviation . Both and are
unknown.
• we want to test:
H 0 : 0 New diet is not effective
versus H A : 0 New diet is effective
The Test Statistic
x 0
t
s
n
1 2 3 4 5 6
2.0 1.0 1.4 -1.8 0.9 2.3
x 0 0.96667 0
t 1.619
s 1.462418
n 6
s
x t / 2
n
The Data
1 2 3 4 5 6
2.0 1.0 1.4 -1.8 0.9 2.3
s
x t0.025
n
1.462418
0.96667 2.571
6
0.96667 1.535
0.57 to 2.50
Summary
Statistical Inference
Estimation by Confidence
Intervals
Confidence Interval for a Proportion
pˆ z / 2 pˆ
p1 p pˆ 1 pˆ
pˆ
n n
Error Bound
Determination of Sample Size
The sample size that will estimate p with an Error Bound B
and level of confidence P = 1 – is:
z a2/ 2 p * 1 p *
n 2
B
where:
• B is the desired Error Bound
• z is the /2 critical value for the standard normal distribution
• p* is some preliminary estimate of p.
Confidence Intervals for the mean
of a Normal Population,
x z / 2 x
or x z / 2
n
s
or x z / 2
n
x sample mean
z / 2 upper / 2 critical point
of the standard normal distribtion
s sample standard deviation
Determination of Sample Size
The sample size that will estimate with an Error Bound B
and level of confidence P = 1 – is:
z s *
2 2 2 2
z
n 2
a/2
2
a/2
B B
where:
• B is the desired Error Bound
• z is the /2 critical value for the standard normal distribution
• s* is some preliminary estimate of s.
Confidence Intervals for the mean of a Normal
Population, , using the t distribution
s
x t / 2
n
Hypothesis Testing
Sampling distribution
of test statistic when H0
is true
pˆ p0 pˆ p0
z
pˆ p0 1 p0
n
Critical Region (dependent on HA)
1. H 0 : 0 versus H A : 0
or
2. H 0 : 0 versus H A : 0
or
3. H 0 : 0 versus H A : 0
The Test Statistic
x 0 x 0 x 0
z
x s
n n
if n is large.
Critical Region (dependent on HA)
x 0 x 0
t
sx s
n
Critical Region (dependent on HA)
x x
2
i
2
s i 1
n 1
The point estimator of the standard deviation is:
n
x x
2
i
s i 1
n 1
Sampling Theory
The statistic
n
x x
2
U i 1
i
n 1 s 2
2 2
0.1
0
2
0 5
10 15 20
Confidence intervals for 2 and .
0.2
2
P 1 / 2
n 1 s 2 2
/ 2 1
2
0.1
/2
/2
0
12 / 2 2 / 2
0 5 10 15 20
Confidence intervals for 2 and .
It is true that
2
P 1 / 2
n 1 s 2
2
/ 2 1
2
from which we can show
n 1 2 2 n 1 2
P 2 s 2 s 1
/ 2 1 / 2
n 1 s n 1 s 1
and P
2 / 2 12 / 2
Hence (1 – )100% confidence limits for 2 are:
n 1 s 2 to
n 1 s 2
2 2
/2 1 / 2
n 1 s to
n 1 s
2
/2 12 / 2
Example
• In this example the subject is asked to type his
computer password n = 6 times.
• Each time xi = time to type the password is
recorded. The data are tabulated below:
i 1 2 3 4 5 6 Sx i Sx i 2
xi 6.63 8.51 9.01 8.69 8.71 8.83 50.38 426.9062
x i
50.38
x i
8.3967
n 6
n 2
xi
n 2
i 1 50.38
xi
2
n
426.9062
6
s i 1 0.881151
n 1 5
95% confidence limits for the mean
s t.025 2.571 for 5 d . f .
x t.025
n
0.881151
or 8.3967 2.571
6
8.3967 0.9249
7.472 to 9.322
2 2
.975 0.8312, .025 12.83 for 5 d . f .
97
5(0.881151) 2 5(0.881151) 2
to 0.303 to 4.671
12.83 0.8312
Testing Hypotheses for 2 and .
Suppose we want to test:
H 0 : 2 02 against H A : 2 02
2
0
or
n 1 s 2
2 1 / 2 2 /2
0 0
0.2
0.1
/2
/2
Reject Accept Reject
0
12 / 2 2 / 2
0 5 10 15 20
One-tailed Tests for 2 and .
Suppose we want to test:
H 0 : 2 02 against H A : 2 02
2
0
We reject H0 if n 1 s 2
02
0.2
0.1
Accept Reject
0
0 5 2 10 15 20
Or suppose we want to test:
H 0 : 2 02 against H A : 2 02
2
0
We reject H0 if n 1 s 2
1
02
0.2
0.1
Reject Accept
0
12
0 5 10 15 20
Example
• The current method for measuring blood alcohol content has the
following properties
– Measurements are
1. Normally distributed
2. Mean = true blood alcohol content
3. standard deviation 1.2 units
• A new method is proposed that has the first two properties and
it is believed that the measurements will have a smaller standard
deviation.
• We want to collect data to test this hypothesis.
• The experiment will be to collect n = 10 observations on a case
were the true blood alcohol content is 6.0
• The data are tabulated below:
i 1 2 3 4 5 6 7 8 9 10 Sx i Sx i 2
xi 5.21 6.90 5.69 5.05 5.75 5.90 6.92 6.48 6.85 5.80 60.55 370.9445
n 2
n xi
i 1
x i xi
2
n
x i
6.0550 s i 1 0.692359, s 2 0.479361
n n 1
To test:
H 0 : 2 1.22 against H A : 2 1.2 2
02
U
9 0.479361
2.996
2
1.2
We reject H0 if
U 1 0.95 3.325 for 9 d . f .