0% found this document useful (0 votes)
33 views59 pages

Hypothesis Testing Statistics

Uploaded by

Mervin Arguelles
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)
33 views59 pages

Hypothesis Testing Statistics

Uploaded by

Mervin Arguelles
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/ 59

EXPERIMENTAL STATISTICS - MATH4B

HYPOTHESIS
TESTING
Intended Learning Outcome
After the completion of the unit, students should be able to:
know the basic concept of statistical hypothesis testing;
apply the steps in hypothesis testing;
determine what kind of statistical test is appropriate for a
specific data; and
draw conclusion and interpretation base on the result of
the test
HYPOTHESIS
TESTING
EXPERIMENTAL STATISTICS - MATH4B
HYPOTHESIS
•A hypothesis is a tentative assertion or statement that
is used to explain a phenomenon.

•A statistical hypothesis is a conjecture about a


population parameter. This conjecture may or may
not be true.
HYPOTHESIS
TESTING
Hypothesis Testing is a statistical procedure which is used to
determine whether the hypothesis is true or not
.
If the hypothesis is found to be true, its accepted
If it is found to be false, it is rejected.
TYPES OF
HYPOTHESES
The null hypothesis, symbolized by H₀, is a statistical
hypothesis that states that there is no difference between
a parameter and a specific value, or that there is no
difference between two parameters.
The alternative hypothesis, symbolized by H₁, is a
statistical hypothesis that states the existence of a
difference between a parameter and a specific value, or
states that there is a difference between two parameters
EXAMPLES

Conjecture: The average system performance benchmark for a specific compute task is 95.
H₀: The average system performance benchmark for a specific compute task is 95. (μ=95).
H₁:The average system performance benchmark for a specific compute task is not 95.
(μ≠95).

Conjecture: The average system performance benchmark for a specific compute task is
lower than 95.
H₀: The average system performance benchmark for a specific compute task is 95. (μ=95).
H₁:The average system performance benchmark for a specific compute task is lower than
95. (μ<95).
EXAMPLES

Conjecture: The average system performance benchmark for a


specific compute task is higher 95.
H₀: The average system performance benchmark for a specific
compute task is 95. (μ=95).
H₁:The average system performance benchmark for a specific
compute task is higher than 95.(μ>95).
EXAMPLE
A researcher hypothesizes that optimizing compiler settings will
improve the execution speed of programs. The average execution
speed of programs in the current setup is 8.6 seconds.
EXAMPLE
An engineer hypothesizes that the mean number of bugs can be
decreased in software development by using automated testing tools
instead of manual testing. The mean number of bugs found per 1000
lines of code is 18.
EXAMPLE
A computer scientist believes that modifying the algorithm for task
scheduling will impact the system's performance. The scientist is
uncertain whether the performance metrics will improve or decline.
Historically, the mean performance score was 73.
HYPOTHESIS
TESTING
EXPERIMENTAL STATISTICS - MATH4B
TYPES OF TESTS
Directional or One-tailed Test is a test of statistical
hypothesis that uses a < or > symbols.

Non-directional or Two-tailed Test is a test of


statistical hypothesis that uses ≠ symbol.

Note: To determine whether the test is directional or


non-directional, look at how the alternative hypothesis
was stated
STATISTICAL TEST
uses the data obtained from a sample to make a
decision about whether the null hypothesis should
be rejected

TEST VALUE
the numerical value obtained from a statistical test
TYPES OF ERRORS
A type I error occurs if you reject the null hypothesis
when it is true.
A type II error occurs if you do not reject the null
hypothesis when it is false.
LEVEL OF
SIGNIFICANCE
the maximum probability of committing a type I error
this probability is symbolized by a (Greek letter alpha - α).
HYPOTHESIS
TESTING
EXPERIMENTAL STATISTICS - MATH4B
CRITICAL VALUE
separates the critical region from the noncritical region. The symbol for critical value is C.V.

CRITICAL OR REJECTION REGION


the range of values of the test value that indicates that there is a significant difference and
that the null hypothesis should be rejected.

NONCRITICAL OR NONREJECTION REGION


qthe range of values of the test value that indicates that the difference was probably due to
chance and that the null hypothesis should not be rejected
EXAMPLE
Find the critical value(s) for each situation and
draw the
appropriate figure, showing the critical region.
a. A left-tailed test with a 0.10.
b. A two-tailed test with a 0.02.
c. A right-tailed test with a 0.005.
HYPOTHESIS
TESTING
EXPERIMENTAL STATISTICS - MATH4B
SOLVING HYPOTHESIS-
TESTING PROBLEMS
(TRADITIONAL METHOD)
Step 1 State the hypotheses and identify the claim.
Step 2 Find the critical value(s)
Step 3 Compute the test value.
Step 4 Make the decision to reject or not reject the null hypothesis.
Step 5 Summarize the result
WHEN TO USE THE Z-TEST?
If the population standard deviation, σ is known
If the sample size is large, n≥30,
Replace σ by s if σ is unknown but n≥30.
ST #1: Z-TEST OF ONE-SAMPLE MEAN
When to use? To compare sample mean and population
mean (x ̅ vs μ)
Test Statistic
CRITICAL VALUES OF Z

One-tailed Two-tailed
test test

α=0.05 ±2.58 ±1.96

α=0.01 ±1.65 ±2.33


EXAMPLE

A researcher wants to investigate whether the mean processing time for a


specific algorithm on a computer cluster is 29 milliseconds. A sample of 30 runs
on different clusters yields a mean processing time of 30.1 milliseconds. Using a
significance level of α = 0.05, test the hypothesis that the mean processing time
is greater than 29 milliseconds. The standard deviation of the processing time
across clusters is 3.8 milliseconds.
EXAMPLE
A researcher asserts that the average response time of a certain web service is
less than 80 milliseconds. They collect a random sample of 36 response times
and record the following values (in milliseconds). (The values have been
rounded to the nearest millisecond.) Is there sufficient evidence to substantiate
the researcher’s assertion at a significance level of α = 0.10? Assume a standard
deviation (σ) of 19.2 milliseconds.
60 70 75 55 80 55
50 40 80 70 50 95
120 90 75 85 80 60
110 65 80 85 85 45
75 60 90 90 60 95
110 85 45 90 70 70
EXAMPLE

The Philippine Computer Society reports that the average cost of developing a
new software system is ₱1,236,400. To investigate whether the average
development cost differs at a specific software development company, a
researcher selects a random sample of 35 software projects and finds that the
average cost of development is ₱1,304,497. The standard deviation of the
population is ₱162,786. At a significance level of α = 0.01, can it be concluded
that the average cost of software development at the particular company differs
from ₱1,236,400?
HYPOTHESIS
TESTING
EXPERIMENTAL STATISTICS - MATH4B
ST # 2: T-TEST OF ONE-SAMPLE MEAN
When to use? To compare sample mean and population
mean (x ̅ vs μ)
σ is unknown
n is small, n<30
THE T DISTRIBUTION IS SIMILAR TO THE STANDARD
NORMAL DISTRIBUTION IN THE FOLLOWING WAYS.
1. It is bell-shaped.
2. It is symmetric about the mean.
3. The mean, median, and mode are equal to 0 and are located at the
center of the distribution.
4. The curve never touches the x axis.
THE T DISTRIBUTION DIFFERS FROM THE STANDARD
NORMAL DISTRIBUTION IN THE FOLLOWING WAYS.
1. The variance is greater than 1.
2. The t distribution is a family of curves based on the degrees of
freedom, which is a number related to sample size.
3. As the sample size increases, the t distribution approaches the
normal distribution. The t test is defined next.
EXAMPLE

Find the critical t value for α = 0.05 with d.f. = 16 for a right-tailed t
test.
Find the critical t value for α = 0.01 with d.f. = 22 for a left-tailed
test.
Find the critical values for α = 0.10 with d.f. = 18 for a two-tailed t
test.
Find the critical value for α = 0.05 with d.f. = 28 for a right-tailed t
test.
EXAMPLE

A software reliability investigation claims that the average number of


software defects reported per week at a technology firm in Metro
Manila is 16.3. A random sample of 10 weeks had a mean number of
17.7 defects reported. The sample standard deviation is 1.8. Is there
enough evidence to reject the investigator’s claim at α = 0.05?
EXAMPLE

A computer science researcher claims that the average hourly rate of


freelance software developers in tech companies in Metro Manila is
less than ₱3,000 per day. A random sample of eight tech companies is
selected, and the daily rates are shown. Is there enough evidence to
support the researcher's claim at α = 0.10?
3000 2600 3000 2500 4000 2500 3000 2500
ST # 3: Z-TEST FOR INDEPENDENT
SAMPLE MEANS
When to use? To compare the means from two
independent samples (x̄ ₁ vs x̄ ₂)
Test Statistic

x̄ ₁= mean of the 1st sample


x̄ ₂= mean of the 2nd sample
n₁= size of the 1st sample
n₂= size of the 2nd sample
σ₁²= population variance of the 1st sample
σ₂²= population variance of the 2nd sample
Difference is not significant Difference is significant
THESE TESTS CAN ALSO BE ONE-TAILED, USING THE
FOLLOWING HYPOTHESES:
THE BASIC FORMAT FOR HYPOTHESIS TESTING
USING THE TRADITIONAL METHOD

Step 1 State the hypotheses and identify the claim.


Step 2 Find the critical value(s).
Step 3 Compute the test value.
Step 4 Make the decision.
Step 5 Summarize the results.
EXAMPLE

In a comparative study between two tech hubs in the Philippines, it


was found that the average hourly rate for software developers in
Manila is ₱1,500 and the average rate in Cebu is ₱1,300. Assume that
the data were obtained from two samples of 50 software developers
each, and that the standard deviations of the populations are ₱200
and ₱180, respectively. At a significance level of α = 0.05, can it be
concluded that there is a significant difference in the rates between
Manila and Cebu?
EXAMPLE

A researcher hypothesizes that the average number of programming


languages taught in computer science departments at colleges for
males is greater than the average number of programming languages
taught for females. A sample of the number of programming
languages offered by colleges is shown. At a significance level of α =
0.10, is there enough evidence to support the claim? Assume
standard deviations σ₁ and σ₂ = 3.3.
ST # 4: T-TEST FOR INDEPENDENT
SAMPLE MEANS
When to use? To compare the means from two
independent samples (x̄ ₁ vs x̄ ₂)
Test Statistic
x̄ ₁= mean of the 1st sample
x̄ ₂= mean of the 2nd sample
n₁= size of the 1st sample
n₂= size of the 2nd sample
s₁²= sample standard deviation of the 1st sample
s₂²= sample standard deviation of the 2nd sample
where the degrees of freedom are equal to the smaller of n₁-1 or n₂-2.
EXAMPLE

The average number of lines of code written per project in tech


startups in Metro Manila is 191. The average number of lines of code
written per project in tech startups in Cebu City is 199. Assume the
data were obtained from two samples with standard deviations of 38
and 12 lines of code, respectively, and sample sizes of 8 and 10,
respectively. Can it be concluded at a significance level of 0.05 that the
average number of lines of code written per project in the two cities is
different? Assume the populations are normally distributed.
ST # 4: T-TEST FOR INDEPENDENT
SAMPLE MEANS
When the variances are assumed to be equal, this
formula is used and
Test Statistic
x̄ ₁= mean of the 1st sample
x̄ ₂= mean of the 2nd sample
n₁= size of the 1st sample
n₂= size of the 2nd sample
s₁²= sample standard deviation of the 1st sample
s₂²= sample standard deviation of the 2nd sample
where the degrees of freedom are equal to the smaller of n₁-1 or n₂-2.
EXPERIMENTAL STATISTICS - MATH4B

STATISTICAL
HYPOTHESIS TESTING
ST # 5: T-TEST FOR DEPENDENT
SAMPLE MEANS
When to use? To compare the means from two
dependent samples (x̄ ₁ vs x̄ ₂)
Test Statistics
D= difference between the
two sets of values
n= sample size
df= n-1
EXAMPLE

A data scientist wishes to investigate if a machine learning


algorithm can affect the accuracy of predicting customer
churn. Six datasets were preprocessed, and then the algorithm
was applied for a 6-week period. The results are shown in the
table. (Accuracy level is measured as a percentage.) Can it be
concluded that the accuracy level has been changed at a
significance level of 0.10? Assume the variable is
approximately normally distributed.
EXAMPLE
Bank Deposits
A sample of nine local banks shows their deposits (in billions of
dollars) 3 years ago and their deposits (in billions of dollars) today. At
a = 0.05, can it be concluded that the average in deposits for the
banks is greater today than it was 3 years ago? Use a = 0.05.
ST # 6: Z-TEST FOR INDEPENDENT
PROPORTIONS
When to use? To compare the proportions from two
independent samples
Test Statistic:
p₁=proportion from the 1st sample
p₂=proportion from the 2nd sample
n₁=size of the 1st sample
n₂=size of the 1st sample
q₁=1-p₁
q₂=1-p₂
EXAMPLE
Vaccination Rates in Nursing Homes
In the nursing home study mentioned in the chapter-opening
Statistics Today, the researchers found that 12 out of 34 small nursing
homes had a resident vaccination rate of less than 80%, while 17 out
of 24 large nursing homes had a vaccination rate of less than 80%. At
a = 0.05, test the claim that there is no difference in the proportions
of the small and large nursing homes with a resident vaccination rate
of less than 80%.
EXAMPLE
Texting While Driving
A survey of 1000 drivers this year showed that 29% of the people
send text messages while driving. Last year a survey of 1000 drivers
showed that 17% of those send text messages while driving. At a
0.01, can it be concluded that there has been an increase in the
number of drivers who text while driving?
EXPERIMENTAL STATISTICS - MATH4B

HYPOTHESIS
TESTING

You might also like