Statistics Assignment DUE Saturday 7/24 by 9PM EST
Hypothesis Testing
Procedure for doing a one-sample z or t
test
Procedure
There are 5 steps to the hypothesis testing process
First, write the null and alternative hypotheses
Second, state the probability of a Type I error (alpha, or a) and state the region of rejection (critical value) of the appropriate distribution (t or z)
Third, calculate the test statistic
Fourth, make a decision about the null hypothesis
Fifth, write a conclusion based in the specific problem at hand
Step 1
Remember, in writing the null hypothesis (H0), it always has an ‘equals’ sign in it, and it is stated in terms of the population value (use m for tests about means)
Example 1: The average speeding ticket costs $128. H0: m = 128
Example 2: The mean cost of gas in TX is less than $3 a gallon. H0: m = 3
Step 1, cont’d
When writing the alternative hypothesis (HA), put the opposite sign as H0 (≠), or use a directional sign if the problem requires it (<, >).
Example 1: The average speeding ticket costs $128. HA: m ≠ 128
Example 2: The mean cost of gas in TX is less than $3 a gallon. HA: m < 3
Step 1, cont’d
So, putting these together, we get
Example 1: The average speeding ticket costs $128. H0: m = 128 HA: m ≠ 128
Example 2: The mean cost of gas in TX is less than $3 a gallon. HA: m = 3 H0: m < 3
Step 1, cont’d
Look at HA to determine if the test is a one-
tailed test or a two-tailed test.
If HA has the not-equal sign (≠), it is a two-tailed
test
If HA has either the less than (<) or the greater
than (>) sign, it is a one-tailed test.
(Note: Some texts use a less-than-or-equal-to (≤)
or greater-than-or-equal-to (≥) sign…same thing
applies.)
Step 2
The probability of making a Type I error is
stated as a. Remember, a Type I error is
rejecting a true null hypothesis.
If a is given in the problem, simply re-state it.
If a is not given, use 0.05 as the default a
rate, unless there is a specific reason for
picking another level.
Conventional a levels are 0.01, 0.02, 0.05, or
0.10
Step 2, cont’d
Once a is established, find the region of rejection by stating the critical value for the test.
If a z test is being done, state a critical z from the z table. We need the number of tails for the test to find this value
If a t test is being done, state a critical t from the t table. We need to know n, and then df, as well as the number of
tails to find this value (remember, df = n – 1 )
Remember, the number of tails is determined by looking at HA.
Step 2, cont’d
Table for finding critical Z values
(two-tailed test, a) 0.20 0.10 0.05 0.02 0.01
(one-tailed test, a) 0.10 0.05 0.025 0.01 0.005
Z 1.28 1.65 1.96 2.33 2.58
Step 2, cont’d
Example from t table for finding a critical t given
6 degrees of freedom, two-tailed, a = 0.05 tc = 2.45
(two-tailed test, a) 0.20 0.10 0.05 0.02 0.01
(one-tailed test, a) 0.10 0.05 0.025 0.01 0.005
df (n - 1)
1 3.08 6.31 12.71 31.82 63.66
2 1.89 2.92 4.30 6.96 9.93
3 1.64 2.35 3.18 4.54 5.84
4 1.53 2.13 2.78 3.75 4.60
5 1.48 2.02 2.57 3.36 4.03
6 1.44 1.94 2.45 3.14 3.71
7 1.41 1.89 2.36 3.00 3.5
Step 3
Calculate the test statistic
Choose the correct formula (z or t, see next slide)
Plug in the numbers and solve
This value is your “observed” value; it is the one
you will compare to the “critical” value in Step 4
Step 3, cont’d
To choose the correct formula,
use the same sequence as in
confidence intervals.
Here’s the sequence to determine
the correct choice-
a) do we know sigma (s)?
If yes, choose #1
If no, ask next question-
b)How big is n?
If n ≥ 30, use #2
If n < 30, use #3
n
so
y z
m
n
o
y z
s
m
2)
1)
3)
n
so
y t
m
Step 4
Make a decision about H0 using the decision rule.
To use the simplified decision rule, first make sure the
value you got in Step 3 is a positive number. If it was
negative, simply change it to positive.
Now use the following rule-
If zo ≥ zc, then reject H0
where zo is the value you calculated in Step 3
and zc is the value you obtained from the table
in Step 2
If you are doing a t test instead of a z test, substitute the ts
in for the zs in the rule.
Step 4, cont’d
Write down your decision
If you chose to reject H0, write, “Reject H0”
If you failed to reject H0, write, “FTR H0” or “fail to
reject H0” or “hold H0 tenable”
Remember, NEVER write “accept H0”
Also remember to test H0, not HA. Just like with
Don Imus, it’s all about the H0.
Step 5
Write your conclusion, in terms of the
problem at hand (see the example below).
Example Problem (z-test)
A researcher wishes to know if a certain antipyretic (fever reducing drug) has a significant effect on body temperature. A sample of 49 guinea pigs is randomly chosen for the test. It is known that the mean body temperature for guinea pigs is 42.0° C with s = 0.8° C. The sample pigs are then infected with a mild virus that is a known pyrogenic (causes a fever). The pigs are then given a dose of the experimental drug, and the following result is found: y = 42.6 C Using a = 0.05, determine if the body temperature of the infected guinea pigs statistically higher than the known population values for healthy pigs.
Example Problem, cont’d
Step 1: Write H0 and HA
H0: m = 42.0
HA: m > 42.0
(note: If you are unsure why we chose ‘>’ for HA, re-read the
question in the problem.)
Example Problem, cont’d
Step 2: State a and the critical value To do this, find a in the problem (or use the default if none is
given)
Determine if the problem is a z or t problem
Using a and z or t, find the critical value in the appropriate table
a = 0.05 (from the problem)
zc = 1.65 (from the z table)
Example Problem, cont’d
Step 3: Calculate the test statistic
We know s, so we use the first formula
0.7 8.0
6.0
o z
49
8.0
0.426.42
o z
n
o
y z
s
m
11.0
6.0
o z 45.5oz
Example Problem, cont’d
Step 4: Make a decision about H0 using the
decision rule
“If zo ≥ zc, reject H0.”
“If 5.45 ≥ 1.65, reject H0.”
Therefore, Reject H0.
Example Problem, cont’d
Step 5: Write the conclusion in terms of the specific
problem at hand.
Do this by converting the hypothesis that remains (in this
case, HA) into “statisticese” language.
Since m in this problem is the body temperature of infected
pigs with the test drug, and HA said m > 42.0, where 42.0 is the healthy pig population body temperature, we state-
“The body temperature of the infected guinea pigs with the test drug
was significantly higher than
the population mean body temperature of healthy guinea pigs.”
Example Problem (t-test)
A researcher wishes to know if a certain antipyretic (fever reducing drug) has a significant effect on body temperature. A sample of 16 guinea pigs is randomly chosen for the test. It is known that the mean body temperature for guinea pigs is 42.0° C with s = 0.8° C. The sample pigs are then infected with a mild virus that is a known pyrogenic (causes a fever). The pigs are then given a dose of the experimental drug, and the following result is found: y = 42.6 C Using a = 0.05, determine if the body temperature of the infected guinea pigs statistically higher than the known population values for healthy pigs.
Example Problem, cont’d
Step 1: Write H0 and HA
H0: m = 42.0
HA: m > 42.0
(note: If you are unsure why we chose ‘>’ for HA, re-read the
question in the problem.)
Example Problem, cont’d
Step 2: State a and the critical value To do this, find a in the problem (or use the default if none is
given)
Determine if the problem is a z or t problem
Using a and z or t, find the critical value in the appropriate table
a = 0.05 (from the problem)
tc = 1.75 (from the t table, one-tailed test)
Example Problem, cont’d
Step 3: Calculate the test statistic
We don’t know s, and n < 30,
so we use the third formula
0.4 8.0
6.0
o t
16
8.0
0.426.42
o t
n
so
y t
m
2.0
6.0
o t 00.3ot
Example Problem, cont’d
Step 4: Make a decision about H0 using the
decision rule
“If to ≥ tc, reject H0.”
“If 3.00 ≥ 1.75, reject H0.”
Therefore, Reject H0.
Example Problem, cont’d
Step 5: Write the conclusion in terms of the specific
problem at hand.
Do this by converting the hypothesis that remains (in this
case, HA) into “statisticese” language.
Since m in this problem is the body temperature of infected
pigs with the test drug, and HA said m > 42.0, where 42.0 is the healthy pig population body temperature, we state-
“The body temperature of the infected guinea pigs with the test drug
was significantly higher than
the population mean body temperature of healthy guinea pigs.”