23 Hypothesis Test using p

When we free ourselves of desire,
we will know serenity and freedom.
1
Inferences about Population
Means
Sections
5.1 -5.7
Estimation
Statistical tests: z test and t test
Sample size selection
2
Estimation
To estimate a numerical summary in population
(parameter):


3
Point estimator — the same numerical
summary in sample; a statistic
Interval estimator — a “random” interval
which includes the parameter most of time
Confidence Interval
ˆL  ˆL (Y1 ,..., Yn )
ˆL  ˆL (Y1 ,..., Yn )
ˆL  ˆL (Y1 ,..., Yn )
ˆU  ˆU (Y1 ,..., Yn )
4
Ideally, a short interval with high confidence interval is preferred.
y
5
Estimation for m


6
Point estimator
Confidence interval
–
Normality with known s or large sample: Z interval
–
Normality with unknown s: t interval
One Population
7
Sample Size for Estimating m
( z / 2 ) s
n
2
E
2
2
if s is unknown,
use s from prior
data or the upper
bound of s.
Where E is the largest tolerable error.
8
The Logic of Hypothesis Test
“Assume Ho is a possible truth until
proven false”
Analogical to
“Presumed innocent until proven guilty”
The logic of the US judicial system
9
Steps in Hypothesis Test
1.
2.
3.
4.
5.
10
Set up the null (Ho) and alternative (Ha)
hypotheses
Find an appropriate test statistic (T.S.)
Find the rejection region (R.R.)
Reject Ho if the observed test statistic falls in
R.R.
Report the result in the context of the
situation
Determine Ho and Ha


The hypothesis with “=“ must be the Ho
The hypothesis we favor (called the research
hypothesis) goes to Ha, if possible.
Eg. Example 5.7 (p.238)
11
Types of Errors
H0 true
we accept H0
we reject H0
Good!
(Correct!)
Type I
Error, or
“ Error”
H1 true
Type II
Error, or
“ Error”
Good!
(Correct)
• Type I error rate will be controlled at a given level, called
significance level or  level
12
Z Test
For normal populations or large samples (n > 30)
Z
y  m0
sy
And the computed value of Z is denoted by Z*.
13
Types of Tests
14
Types of Tests
15
Types of Tests
16
Power of Test

Example 5.7 revisit (p. 240)
17
Sample Size for Testing m
The type I, II error rates are controlled
at ,  respectively and the maximum tolerable error is :
( z  z  ) s
2
One-tailed tests:
n

2
( z / 2  z  ) s
2
Two-tailed tests:
18
n
2

2
2
P-value (Observed Significant Level)




19
p-value is the probability of seeing what we observe as
far as (or further) from Ho (in the direction of H1) given
Ho is true; the smallest  level to reject Ho
p-value is computed by assuming Ho is true and then
determining the probability of a result as extreme (or
more extreme) as the observed test statistic in the
direction of the H1.
The smaller p-value is, the less likely that what we
observe will occur under the assumption Ho is true.
Smaller p-value means stronger evidence against Ho.
Computing the p-Value for the Z-Test
20
Computing the p-Value for the Z-Test
21
Computing the p-Value for the Z-Test
P-value = P(|Z| > |z*| )= 2 x P(Z > |z*|)
22
Hypothesis Test using p-Value
1.
2.
3.
4.
5.
23
Set up the null (Ho) and alternative (H1)
hypotheses
Find an appropriate test statistic (T.S.)
Find the p-value
Reject Ho if the p-value < 
Report the result in the context of the
situation
Example 5.7 (Page 238)

24
Redo it using the p-value way
t Test

For normal populations with unknown s
t = the same formula for Z
but replacing s by s
Eg. Revisit Example 5.7
25
One Population
26
INFERENCES ABOUT MEAN
WHEN “BEYOND THE SCOPE”
When population is nonnormal and n is small, how to do
inferences about m:
1). Use Bootstrap methods to simulate the sampling
distribution of t test statistic
2). Use the simulated distribution to find an (approximate)
C.I. and p-value
27
Introduction to Bootstrap Methods
How to simulate the sampling distribution of a given statistic, say t, based
on a given sample of size n:
1. Pretend the original sample is the entire population
2. Select a random sample of size n from the original sample (now the
population) with replacement ; this is called a bootstrap sample
3. Calculate the t value of the bootstrap sample, t*
4. Repeat steps 2, 3 many times, 1000 or more, say B times. Use the
obtained t* values to obtain an approximation to the sampling
distribution
Minitab steps for obtaining bootstrap samples (p. 264)
28
Example 5.18, 5.19 (p. 261-263)