0% found this document useful (0 votes)
105 views

Hypothesis Testing: Before Any Sample Readings Are Considered

1. State the null (H0) and alternative (H1) hypotheses. The null hypothesis states there is no difference or effect, while the alternative hypothesis states there is a difference or effect. 2. Select the appropriate statistical test based on the population parameter. Common tests include z-tests for means and proportions and t-tests. 3. Determine the critical value(s) which separate the rejection region from the non-rejection region based on the significance level and type of test.

Uploaded by

Siti Maimunah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
105 views

Hypothesis Testing: Before Any Sample Readings Are Considered

1. State the null (H0) and alternative (H1) hypotheses. The null hypothesis states there is no difference or effect, while the alternative hypothesis states there is a difference or effect. 2. Select the appropriate statistical test based on the population parameter. Common tests include z-tests for means and proportions and t-tests. 3. Determine the critical value(s) which separate the rejection region from the non-rejection region based on the significance level and type of test.

Uploaded by

Siti Maimunah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

STA408 – Statistics for Sciences & Engineering Hypothesis Testing

HYPOTHESIS TESTING

Introduction STEPS INVOLVED IN HYPOTHESIS TESTING –


There are questions which needs answers. For The traditional method
instance,
§ a scientist might want to know whether the Before any sample readings are considered
earth is warming up.
§ A physician might want to know whether a STEP 1: State the Hypothesis
medication will lower a person’s blood pressure There are two types of hypothesis: the null
§ An educator might wish to see whether a new hypothesis and the alternative hypothesis.
teaching technique is better than a traditional
one The Null Hypothesis (H 0 ) ~ a statistical
All these questions can be addressed through
statistical hypothesis testing (a decision-making hypothesis that states that there is no difference
process for evaluating claims about a population) between a parameter and a specific value or that
there is no difference between two parameters.
Three methods used to test hypotheses
1. The traditional method The Alternative Hypothesis (H 1 ) ~ a statistical
2. The p-value method hypothesis that states a specific difference
3. The confidence interval method between a parameter and a specific value or states
that there is a difference between two parameters.
Consider the following statements or claims:
1. The label on a packet of Tong Garden’s Salted Eg. 1
Cashew Nuts states, net weight: 80 grams. Consider all the situations below:
2. A survey conducted by AC Nielson reports that
5% of urban adults in Peninsular Malaysia Situation A
claim to own a credit card. A medical researcher is interested in finding out
whether a new medication will have any
The above statements are all examples of undesirable side effects. He is particularly
hypothesis and all of them state the value of a concerned with the pulse rate of the patients who
population parameter. take the medication. He knows that the mean pulse
rate for the population under study is 82 beats per
\ Hypothesis ~ a statement or claim made about minute.
the value of a population parameter. The hypotheses for this situation are:
H 0 : µ = 82
These claims/statements are assumed to be true
unless they are proven to be otherwise. H 1 : µ ¹ 82

\ Statistical Hypothesis ~ a conjecture or Situation B


assumption about a population parameter. This A chemist invents an additive to increase the life of
conjecture may or may not be true. an automobile battery. It is known that the mean
lifetime of the automobile battery is 36 months.
Hypothesis Testing The hypotheses for this situation are:
Statistical hypothesis testing can test the validity of H 0 : µ £ 36
the claims. This is a decision-making process
starting with the hypothesis statement. H 1 : µ > 36

\ Hypothesis Testing ~ a procedure whereby Situation C


sample information is used to decide whether to A contractor wishes to lower heating bills by using
accept or reject the statement made regarding the a special type of insulation in houses. The average
value of the population parameter. of the monthly heating bills is $78.
The hypotheses for this situation are:
H 0 : µ ³ $78
H 1 : µ < $78

Note: To state the hypotheses, the conjecture


must be translated from words to mathematical
symbols.

Aida Wati Zainan Abidin Page 1


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

STEP 2: Select the Correct Statistical Test Eg. 2


Statistical Test ~ uses the data obtained from a The Environment Department has issued a set of
sample to make a decision about whether or not guidelines regarding industrial wastes that is
the null hypothesis should be rejected. produced by the manufacturing industries.
Manufacturing factories that produce industrial
The statistical test depends on the population wastes, which is more than 3ppm, will be fined.
parameter being examined (given by the null In making a conclusion for the hypothesis testing
hypothesis) i.e. if examining the population mean in (a), there is a possibility that two types of errors
and the population standard deviation is known, may occur.
the appropriate statistical test would be the Z -
test. a) Not issuing a fine to the factory while its mean
industrial waste produced is more than 3ppm.
Test Value or Test Statistics ~ the numerical value b) Issuing a fine to a factory while its mean
obtained from the statistical test. industrial waste produced is less than 3ppm.
Name and give the definition for the type of errors
made.
STEP 3: Determine the Critical Value
In the hypothesis-testing situation, there are four Critical Value(s) (C.V .) ~ separates the critical
possible outcomes. region from the non-critical region.
Critical or Rejection Region ~ the range of values
H 0 True H 0 False of the test value that indicates that there is a
significant difference and the null hypothesis
Reject Error Correct should be rejected.
H0 Type I Decision
Non-critical or Non-rejection region ~ the range of
Do not values of the test value that indicates that the
reject Correct Error difference was probably due to chance and that the
Decision Type II null hypothesis should not be rejected.
H0
There are three types of tests in hypothesis
Type I Error ~ occurs if one rejects the null testing, depending on the direction of the inequality
hypothesis when it is true. of the alternative hypothesis.

Type II Error ~ occurs if one does not reject the null One-Tailed Right Test ~ indicates that the null
hypothesis when it is false. should be rejected when the test value is in the
critical region on the right side of the mean.
Level of Significance (a ) ~ the maximum
Eg. 3
probability of committing a type I error. That is
Consider situation B in Eg. 1.
P(type I error ) = a .
One-Tailed Left Test ~ indicates that the null
a is decided by the researcher. It means that should be rejected when the test value is in the
there is an a % chance of rejecting a true null critical region on the left side of the mean.
hypothesis.
Eg. 4
The probability of type II error is denoted as: Consider situation C in Eg. 1.
P(type II error ) = b Two-Tailed Test ~ the null hypothesis should be
rejected when the test value is in either of the two
critical regions.

Eg. 5
Consider situation A in Eg. 1.

Note: To obtain a critical value, a - level must be


chosen first. For two-tailed test, a is divided into
2 equal parts.

Aida Wati Zainan Abidin Page 2


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

Eg. 6 Test on Sample Mean: s Known


State the null and alternative hypotheses for each When making inferences about the population
conjecture. Determine whether it is a one-tailed mean for large sample case, the test statistic
test or two-tailed test. x-µ
a) A researcher thinks that if expectant mothers formula is Z= where Z ~ N (0,1)
use vitamin pills, the birth weight of the babies s
will increase. The average of the birth weights n
of the population is 3.1 kg.
b) An engineer hypothesizes that the mean where x = sample mean
number of defects can be decreased in a
manufacturing process of compact discs by µ = the population mean as in H 0
using robots instead of humans for certain s = the population standard deviation
tasks. The mean number of defective discs per n = sample size
1000 is 18.
c) A psychologist feels that playing soft music Eg. 8
during a test will change the results of the test. A company producing ‘AAA’ batteries claims that
The psychologist is not sure whether the its batteries last an average of 24 months with a
grades will be higher or lower. In the past, the standard deviation of 3 months. A sample of 36
mean of the scores was 73. batteries was tested. The mean life of these
batteries was 23 months. Using the 5% level of
Procedure for finding the Critical Values for a significance, is there evidence to indicate that the
specific a values mean life of ‘AAA’ batteries is below 24 months?

1. Draw the figure and indicate the appropriate Test on Sample Mean: s Unknown
area. When the population is normally distributed, the
2. Find the critical value correspond to the area. distribution of sample means will also be normally
3. Determine the sign of the critical value. distributed irrespective of sample size. However, if
the population standard deviation unknown, the
STEP 4: Decide on The Decision Criteria appropriate test statistic formula is as follows:
Decision Rule ~ summary of deciding whether to
accept or reject the null hypothesis based on the x-µ
comparison between the critical value and the test T= where T ~ t (n - 1)
statistics. s
n
Now consider the sample values
when s unknown.
STEP 5: Calculate the Test Statistic Value
Required condition: Population is normally
( )
This step can also be done in Step 2 when the
statistical test is decided. distributed, that is X ~ N µ ,s 2

STEP 6: Make a Decision and Draw a Conclusion Eg. 9


A machine packs flour into bags. A random sample
The final step is to make an inference regarding of eleven filled bags was taken and the masses of
the population parameter. the bags to the nearest 0.1kg were

If the value of the test statistic lies in the critical 1506.8 1507.2 1506.6 1506.7 1506.9 1506.8
region, reject H 0 . 1506.6 1507.0 1507.5 1506.3 1506.4.
If the value of the test statistic does not lie in the Filled bags are supposed to have a mass of
critical region, do not reject H 0 . 1506.5g. Assuming that the mass of a bag has a
normal distribution, test whether the sample
provides significant evidence at the 5% level that
If H 0 is rejected at 5% level, then it is said that the the machine produces overweight bags.
test value is ‘significant’.
If H 0 is rejected at 1% level, then it is said that the
test value is ‘highly significant’.

Eg. 7
Write the decision rule for each situation in Eg. 3
to Eg. 5.

Aida Wati Zainan Abidin Page 3


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

Eg. 10 July 2017


On her first day of work as a waitress at Jade A random sample of 30 jars is selected to
Restaurant in Damansara Utama, Swee Kim was determine the amount of carbonated drinks (in ml)
told by her colleagues that she can expect to take filled by a machine. It is found that the mean and
home an average of about RM15 per day on tips. standard deviation is 345ml and 20ml,
After working for about 20 days, Swee Kim respectively. Assume that the amount of
estimated her mean tips per day as RM14.10 with carbonated drinks in a jar is normally distributed,
a standard deviation of RM2.20. At the 5% level of test the hypothesis that the population mean is
significance, is there any evidence to indicate that more than 340ml . Use 𝛼 = 0.05.
her mean tips per day is not RM15.

Eg. 11 TESTS CONCERNING DIFFERENCE OF TWO


A normal distribution is thought to have a mean of MEANS (INDEPENDENT SAMPLES)
50 and standard deviation of 4.5. A random sample
of 100 gave a mean of 52.6. Is there evidence that Suppose we’re interested to determine whether
the population mean has increased there is a difference in mean between two
a) at the 5% level? samples. Therefore, we are interested in
b) at the 1% level? comparing the means of the two groups.

Eg. 12 The hypotheses will be:


The lengths of metal bars produced by a particular H 0 : µ1 = µ 2
machine are normally distributed with mean length
420cm and standard deviation 12cm.The machine H 1 : µ1 ¹ µ 2 or H 1 : µ1 < µ 2 or H 1 : µ1 > µ 2
is serviced, after which a sample of 100 bars gives
a mean length of 423cm. Is there evidence, at the where µ1 and µ 2 are the means for sample 1 and
5% level, of a change in the mean length of the
sample 2 respectively.
bars produced by the machine, assuming that the
standard deviation remains the same?
Another way of stating the hypotheses is:
Eg. 13 H 0 : µ1 - µ 2 = 0
Five readings of the resistance, in ohms, of a piece H 1 : µ1 - µ 2 ¹ 0
of wire gave the following results
Assumptions for the Test
1.51 1.49 1.54 1.52 1.54
a. The samples must be independent of each
other.
If the wire were pure silver, its resistance would be
b. The populations from which the samples were
1.50 ohms. If the wire were not pure, the resistance
obtained must be normally distributed, and the
would be increased. Test, at the 5% level, the
standard deviations of the variable must be
hypothesis that the wire is pure silver.
known.
Eg. 14
Consider two unpaired, independent samples of
A variable with known variance of 32, is thought to
have a mean of 55. A random sample of 20 sizes n1 and n 2 such that
independent observations gives a mean of 56.2. Is X 1 ~ N ( µ1 , s 1 ) and X 2 ~ N ( µ 2 , s 2 )
2 2
there sufficient evidence that the mean is not 55 at
the 10% level?
æ s 2 s 2ö
Jan2018 Then, X 1 - X 2 ~ N çç µ1 - µ 2 , 1 + 2 ÷÷
A light bulb manufacturer guarantees that the è n1 n2 ø
mean life of a certain type of LED light bulb is more
than 25000 hours. A random sample of 26 LED The distribution is known as the sampling
light bulbs has a mean life 27450 hours with a distribution of difference between means.
standard deviation of 6000 hours. Is there enough
evidence to support the manufacturer’s claim? Use
𝛼 = 0.05.

Aida Wati Zainan Abidin Page 4


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

With Known Variance Adv. I in M


If s 1 and
2
s2 2
are known, the statistical test to Mekro TV Adv. II in Meta TV
be used is x1 = 60 x 2 = 56
2 2
s1 = 466.0 s 2 = 420.0
x1 - x 2 - (µ1 - µ 2 )
Z= where Z ~ N (0,1) .
Is the data above supporting the claim that the
s 12 s 22
+ mean score for advertisement I and II are
n1 n2 different? Use a = 0.05 and assume the variance
of both populations to be the same.
Eg. 15
A random sample of size 100 is taken from a Eg. 18
A furniture factory manager wants to rate the
normal population with variance s 1 2 = 40 . The performance of an inspector in a new factory. 13
sample mean x1 is 38.3. Another random sample new inspectors and 9 experienced inspectors are
of size 80, is taken from a normal population with selected and each inspector inspected 200
wooden products and they were required to
variance s 2 = 30 . The sample mean x 2 is 40.1.
2
categorize whether the production were defective
Test, at the 5% level, whether there is a significant or not. The number of mistakes ( x ) made by each
difference in the population means µ1 and µ 2 . inspector gave the following results:

Eg. 16 Experienced
New Inspectors
The same test was given to a group of 100 scouts Inspectors
and to a group of 144 guides. The mean score for x1 = 32.77 Mean = 21.11
the scouts was 27.53 and the mean score for the 2
guides was 26.81. Assuming a common s1 = 68.53 Variance = 121.11
population standard deviation of 3.48, test using a
5% level of significance, whether the scouts’
It is found that the number of mistakes made by
performance in the test was better than that of the
the inspectors above is distributed normally with
guides. Assume that the scores are normally
equal variances. Do experienced inspectors make
distributed.
fewer mistakes than new inspectors? Test at the
5% significance level.
With Unknown Common Variance
When there is an unknown common population
TESTS CONCERNING DIFFERENCE OF TWO
variance s then an estimate Sp can be used.
2 2
MEANS (DEPENDENT SAMPLES)
2
The formula for Sp is:
If the samples are not independent, i.e. there are
where, matched or paired, the test should be conducted
2 2
s1 and s 2 are the sample variances of sample 1 as if one sample where the difference between
each pair is considered.
and sample 2 respectively.
Hence, the statistical test would be:
2
After obtaining the pooled variance, Sp the test
statistics formula can be calculated as below: d - µd
T= where T ~ t (nd - 1)
sd
where T ~ t (n1 + n 2 - 2 ) .
nd
Eg 17 where,
Two different advertisements for mobile
telephones were aired on two TV channels. The µ d = population mean difference in the obs.
two advertisements were aired to two groups of 31
individuals each in the studio and they were asked d = sample mean difference in the obs.
to evaluate the advertisement they watched. The s d = standard deviation of the differences
following results were obtained:
nd = number of differences

Aida Wati Zainan Abidin Page 5


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

Eg. 19 Eg. 21
The data below shows the typing speed in words Putra Line acts as a feeder bus to transport
per minute, before and after a typing course. passengers from various bus stops to the nearest
LRT station. Drivers of Putra Line are required to
Speed Before Speed After maintain consistent schedules to enable
Typist Course Course passengers to catch the LRT on time. The
(words per mins) (words per mins) management of the bus company has set a
standard which specifies an arrival time with a
A 25 35
variance of 5 minutes or less. Arrival time is
B 35 40
measured in minutes. A sample of 12 bus arrivals
C 35 35
at a particular bus stop was collected. The
D 30 40
variance of the arrival times was 5.9 minutes. At
E 45 45
the 2.5% level of significance is there evidence to
F 40 45
conclude that the variability of the arrival times is
larger than that specified by the management of
Using 1% level of significance, is there a the company?
significance increased in typing speed after
attending the typing course? Testing the Difference Between Two
Population Variances
Testing a Population Variance The hypotheses when testing for the difference
The same steps hypothesis testing is also used between two population variances are:
when making inferences about a population
s 12
variance. H0 = =1
s 22
The hypotheses will be:
s 12 s 12
H 0 : s 2 = s 02 H1 = ¹1 or H1 = < 1 or
s 22 s 22
H1 : s 2 ¹ s 02 or H1 : s 2 < s 02
s 12
or H1 :s 2
>s0 2 H1 = >1
s 22
The formula for the test statistics is as follows:
The test statistics is:
c2 =
(n - 1)s 2 s1 2
2
s F=
s2 2
where c 2 = chi-square variable
s 2 = sample variance Required Condition: The population are normally
s 2 = population variance as stated in the distributed.
hypothesis
n = sample size Eg. 22
Ganesan works as a technician at Lingam’s Flour
Required Condition: Population should be Mills. His job is to make sure that the packing
normally distributed. machines are functioning properly. Ganesan
knows that the variances of the weight of the
Eg. 20 packets of flour packed by each machine are an
A pharmaceutical company uses a machine to important measure in determining whether the
pour cough mixtures into bottles in such a way that machines are functioning well. A large variance
the standard deviation of the amount of mixture would mean that the machine needs to be adjusted
was selected. The standard deviation of the or repaired. Ganesan selected a sample of 9
amount of mixture in each bottle is 0.12 ounces. A packets of flour packed by machine A and 13
sample of 41 bottles of cough mixture was packets of flour packed by machine B. The mean
selected. The standard deviation of the amount of and standard deviation of the weights of the flour
mixture in the bottles was 0.09 ounces. At the 5% is shown in the following table:
level of significance can we conclude that there is
a difference in the variability of the mixtures in each Machine A Machine B
bottle? Assume that the mounts of mixture in the x1 = 520 grams x2 = 520.5 grams
bottles are normally distributed. s1 = 15 grams s2 = 30 grams

Aida Wati Zainan Abidin Page 6


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

STEPS INVOLVED IN HYPOTHESIS TESTING –


The p-value Method Hence, solving Hypothesis testing (P-value
Method)
Statisticians usually test hypotheses at the
common a level of 0.05 or 0.01 and sometimes at STEP 1 : State the hypotheses (identify the
0.10 depending on the seriousness of the type I claim/alternative hypothesis)
error. Many computer statistical packages give a
P-value for the hypothesis tests. STEP 2 : Select statistical test and Compute the
test statistic value
P-value (probability value) is the probability of
getting a sample statistic (such as the mean) or a STEP 3 : Find the P-value
more extreme sample statistic in the direction of
the alternative hypothesis when the null STEP 4 : State the decision rule
hypothesis is true.
Decision Rule When using a P-value:
P-value – actual area under the standard normal If 𝑃 − value ≤ α , reject the null hypothesis.
distribution curve (or other curve, depending on If 𝑃 − value > α , do not reject the null hypothesis
which statistical test is being used) representing
the probability of a particular sample statistic or a STEP 5 : Decision and Conclusion
more extreme sample statistic occurs when the
null hypothesis is true. Eg. 24
Researcher wishes to test the claim that the
Eg. 23 average cost of tuition and fees for a year in a
Suppose we’re testing public university is greater than RM5700. She
𝐻' = 𝜇 = 50 vs 𝐻* = 𝜇 > 50 selects a random sample of 36 students and finds
and the sample mean, 𝑋 = 52 (for a given sample the mean to be RM5950. The population standard
size and standard deviation) deviation is RM659. Is there evidence to support
the claim at 𝛼 = 0.05? Use the P-value method.
If the computer printed a P-value = 0.0356 for a
statistical test, then it’s mean Eg. 25
𝑃 𝑋 > 52 = 0.0356 A researcher claims that the average wind speed
in a certain city is 8km/per hour. A sample of 32
Hence, the null hypothesis will be rejected at 𝛼 = days has an average wind speed of 8.2 km/per
0.05 but not 𝛼 = 0.01 hour. The standard deviation of the population is
0.6 km/per hour. At 𝛼 = 0.05, is there enough
evidence to reject the claim? Use the P-value
method.

Eg. 26
From the output below, test the claim that the
average salary for substitute teachers is less than
RM60 per day. Use 𝛼 = 0.05.

One-Sample T: Salary
However, if we’re testing
Test of mu = 60 vs < 60
𝐻' : 𝜇 = 50 vs 𝐻* : 𝜇 ≠ 50
90% Upper
Variable N Mean StDev SE Mean Bound T P
the P-value obtained must multiply by 2. Hence the Salary 8 58.8750 5.0832 1.7972 61.4179 -0.63 0.276
P-value = 0.0356 x 2 = 0.0712

Hence, the null hypothesis can only be rejected at


be rejected at 𝛼 = 0.10 but not at 𝛼 = 0.05

Aida Wati Zainan Abidin Page 7


STA408 – Statistics for Sciences & Engineering Hypothesis Testing

Jan 2018
a) Researchers speculate that drivers who do not wear a seatbelt are more likely to speed than drivers
who do not wear. A random sample of 20 drivers had their speed measured at a certain point.
Assume that the speed is approximately normally distribute. The summary outputs from the data
analysis software are shown below.
Test and CI for Two Variances: no_seatbelt, with_seatbelt
Method
Null hypothesis Sigma(no_seatbelt) / Sigma(with_seatbelt) = 1
Alternative hypothesis Sigma(no_seatbelt) / Sigma(with_seatbelt) ≠ 1
Statistics
Variable N StDev Variance
no_seatbelt 8 6.077 36.928
with_seatbelt 12 8.663 75.050

Ratio of standard deviations = 0.701


Ratio of variance = 0.492

Tests
Test
Method DF1 Df2 Statistics P-value
F test 7 11 0.49 0.356

Two-Sample T-Test and CI: no_seatbelt, with_seatbelt

Two-sample T for no_seatbelt vs with_seatbelt

N Mean StDev SE Mean


no_seatbelt 8 72.43 6.077 2.1
with_seatbelt 12 65.25 8.663 2.5

Difference = mu (no_seatbelt) – mu (with_seatbelt)


Estimate for difference: 7.18
95% lower bound for difference: 1.03
T-Test of difference = 0 (vs >): T-Value = 2.03 P-Value = 0.0209 DF = 18
Both use Pooled StDev = 7.7605

i) Based on the output, investigate if there is a difference in the variability of the speed for the two
groups of drivers? Test at 5% significance level.
ii) Is there enough evidence to support the claim that drivers who do not wear seatbelts travel faster
on the average? Use 𝛼 = 0.05.

b) The average weekly loss of labour hours due to accidents in the factories is studied on 10 labours
before and after a new industrial safety awareness program. The Minitab output is shown on the
right.
i) Construct the 95% confidence interval for the difference in mean of the weekly loss of labour
hours before and after the industrial safety awareness program is conducted. Interpret the
confidence interval
ii) Do the data provide evidence that the industrial safety awareness program is effective? Test at
1% level of significance.

Paired T-test and CI: before, after


Paired T for h_before – h_after

N Mean StDev SE Mean


h_before 10 53.8 32.1 10.1
h_after 10 48.6 31.0 9.8
Difference 10 5.20 4.08 1.29

T-Test of mean difference = 0 (vs > 0): T-Value = 4.03 P-Value = 0.001

Aida Wati Zainan Abidin Page 8

You might also like