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

10 Hypothesis Testing

Uploaded by

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

10 Hypothesis Testing

Uploaded by

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

Hypothesis Testing

What’s the purpose of Hypothesis testing?

Popul
ation
• Unknown Population parameters
para
mete
r
• Establish hypothesis about the population that’s testable on the
Rese
arch sample.
Hypo • Hypothesis is clear, brief, testable.
thesi
s
• Sample data, analysis and interference
Hypo
thesi
• Support or refute the research hypothesis
s • Make conclusions about the sample statistics
testin
g
Hypothesis Testing
• The general goal of a hypothesis test is to rule
out chance (sampling error) as a plausible
explanation for the results from a research
study.
• Hypothesis testing is a technique to help
determine whether a hypothesis is true (e.g.
treatment, procedure has an effect in a
population), or simply if a relationship exists
between two or more variables.
Research hypothesis vs Null hypothesis
Research hypothesis (H1) is what the research believes to be a true
reflection on the general population. Another word, a true
explanation for a phenomena in the population. The researcher
wants to prove that his sample statistics is different than the
population parameters. Research hypothesis is also called
alternative hypothesis
Null hypothesis (H0) is the opposite of H1. The H0 assumes no
difference of test statistics and the population parameter. This
means that the researcher hypothesis about a certain phenomena
is not correct, and that there is no real difference between sample
and population for a certain feature or difference is due another
reason (that is not tested).
Null Hypothesis vs Alternative Hypothesis
Null hypothesis H0 Alternative Hypothesis H1
There is no relationship or There is a relationship or
difference difference
Refers to the population Refers to the examined sample
Research aims to reject the null Research aims to accept the
alternative
Represent an original Prove statistically a systemic
assumption difference or relationship
Assumes a difference is due to Assumes that difference is less
chance likely to be due to chance.
How to establish a good hypothesis?
• Clear and declarative statement. Not a
question.
• Show a relationship between variables
• Reflect a body of literature or a theory
• Be direct, explicit, and to the point.
• Be testable and measurable.
Six Steps of Hypothesis testing
1. Set your hypothesis.
2. Set level of significance associated with the hypothesis.
3. Compute the appropriate test statistics (t-test, F-test, Chi-
square, etc.).
4. Set the critical value needed to reject the null hypothesis
(from Tables).
5. Compare the test statistics value with the critical value of
rejection.
6. Decide whether to reject the null hypothesis and confidence
statement.
Step 1
• Set your hypothesis
Set both H0 & H1.
Step 2
• Set level of significance associated with the
hypothesis.

1% 2.5% 5% 5% 2.5% 1%
Step 3
• Compute the appropriate test statistics (t-test,
F-test, Chi-square, etc.).
1. Determine which test statistics you should
used based on the research question.
2. Determine the comparison measurement (i.e.
mean, variance).
3. Do the statistical test to define where the
obtained value is located on the standardized
curve of the distribution
Step 4
• Set the critical value needed to reject the null
hypothesis (from Tables).
• You might need the table of Z-test, t-test, F-
test.
• Based on the chosen table, look for the cut off
value based on the level of significance you
determined in step 2.
Step 5
• Compare the test statistics value with the
critical value of rejection.
Does Z-value = or value from the table
Step 6
• Decide whether to reject the null hypothesis
and confidence statement.

No difference

There is difference that’s less There is difference that’s less


likely to be due to chance alone likely to be due to chance alone
Rejection or Acceptance of test value
Rejection of the H0 and a
• The test relies on the level of significance, a = P(Reject H0|H0 is true).
• However, if test statistics show that we have to reject the H0 , When it
happens to be true, the chance is low (less than 1%, 2.5%, 5%).
• Use this statement when you get a significant result (Rejection of the
Null): “The chance the that the alternative hypothesis is true due to
chance only is less 1%, 2.5%, 5%”
• Level of significance represents a proportion of area in a sampling
distribution that equals the probability of rejecting the true null
hypothesis.
• This area in the sampling distribution is called Region of Rejection,
and it represents those values of the sample mean that are
improbable if the null hypothesis is true
P-value
• These values (1%, 2.5%, 5% ) are levels of significance which
determine if you are rejecting the H0 or not. It’s your
decision criteria for which your data is significant or not.
• Level of significance is a probability (of rejecting a true Null)
• All computing statistical packages provide P-values.
However, you still need to estimate the significance of the
data using statistical tables. The statistical computing
package gives you the exact P-value.
• P-value represents the smallest a. Yet, we still reject H0
• P = .05 : the researcher’s decision to reject the Null may be
incorrect 5% of the time (1 chance in 20)
Levels of significance and critical values

The locations of the critical region boundaries for three different levels of significance:
α = .05, α = .01, and α = .001.
Type 1 & Type 2 errors
• Type 1 error: reject the null when the null is true
– P (Type I error) = α level or level of significance
• Type 2 error: accept the null when the null is false
– P (Type II error): β level
– Type 2 error reflects what’s called Power
– Power = 1 – β
– As sample size increases, Type II error decreases
– If other factors are constant, raising α level from .05 to
.10, β level decreases
Questions on Type 1 & 2 errors
• If the power of the study decrease, what
happens to α level ? decrease
• If a researcher is less confident about his
hypothesis, which error will increase? Beta
• If you are about to loose a million $ from
rejecting the null, which error should you
decrease? Alpha
• If you increase your sample size, what will
happen to α, β, and power? Increase, dec, inc
Hypothesis Testing for m
• Step 1:Set your hypothesis
H0: m=m0, H1: m>m0, m<m0, m≠m0
• Step 2: Set level of significance associated with the hypothesis
a = 0.05
• Step 3: Compute the appropriate test statistics
Test Statistic
When n>30 n<30
X - μ0
t
s/ n
• Step 4: Set the critical value needed to reject the null hypothesis (from Tables).
Critical values for a = 0.05 is 1.96 in a 2-tailed test.
• Step 5: Compare the test statistics value with the critical value of rejection.
Suppose we got a test statistics of 2. This is larger than 1.96.
• Step 6: Decide whether to reject the null hypothesis and confidence statement.
reject the H0. ….
Z-test
• Used to determine probability that a given
sample is representative of the known
population
• H0 : the two means represent the same
population
(hypothesized population mean = known
population mean)
• You can use the z test only when μ and σ are
known
‘Z’ as a statistical test
• Z test-statistic converts a sample mean into a z-score from the
null distribution.
•Zcrit is the criterion value of Z that defines the rejection region
•Ztest is the value of Z that represents the sample mean you
calculated from your data
X  H0
Z test 
X
• p-value is the probability of getting a Ztest as extreme as yours
under the null distribution
• All test statistics are fundamentally a comparison between what
you got and what you’d expect to get from chance alone
One-tailed tests

• Left-tailed: If HA states  is < some value, critical region


occupies left tail

• Right-tailed: If HA states  is > some value, critical region


occupies right tail
Right-tailed tests
H0: µ = 100
H1: µ > 100

Points Right

Fail to reject H0 Reject H0

alpha

Values that
differ “significantly”
100 Zcrit
from 100
Left-tailed tests
H0: µ = 100
H1: µ < 100

Points Left

Reject H0 Fail to reject H0

alpha

Values that
differ “significantly” 100
Zcrit
from 100
Two-tailed hypothesis testing
• HA is that µ is either greater or less than µH0
HA: µ ≠ µH0

•  is divided equally between the two tails of the


critical region
Two-tailed hypothesis testing
H0: µ = 100
H1: µ  100

Means less than or greater than

Reject H0 Fail to reject H0 Reject H0

alpha

Zcrit 100 Zcrit


Values that differ significantly from 100
One tale critical values
alpha .05, Zcrit=1.65;
alpha .01, Zcrit=2.33

Two tale critical values


alpha .05, Zcrit=1.96;
alpha .01, Zcrit=2.58
One- vs. two-tailed tests
• In theory, should use one-tailed when
1. Change in opposite direction would be meaningless
2. Change in opposite direction would be uninteresting
3. No opposing theory predicts change in opposite
direction
Example – Hypothesis testing
The National Center for Health Statistics (NCHS) reports that
for adults participants, the mean total cholesterol is 203.

A sample of participants (n=3310) from the Framingham


Heart Study, have a mean total cholesterol of 200.3 with a
standard deviation of 36.8.

Are cholesterol levels in participants from the Framingham


study significantly different from the mean total cholesterol
of the national population?
a= 0.05
Example _ Framingham
1. H0: m=203 H1: m≠203 This is a 2-Tailed test

2. a=0.05 Critical Values for 2-Tailed test


a Z
X - μ0 0.2 1.282
3. Z
s/ n 0.1 1.645
0.05 1.96
4. Reject H0 if z > 1.96 or if z < -1.96 0.01 2.576
0.001 3.291
X - μ 0 200.3  203 0.0001 3.819
5. Z    4.22
s/ n 36.8 / 3310
6. Since -4.22 <-1.96, we Reject H0. There is a statistically significant evidence at
a=0.05 to show that the mean total cholesterol in participants of the Framingham
Heart Study is different than national mean. The chance that the sample and the
population means are different due to chance only is less than 5%.
Example rats
• A certain breed of rats shows a mean weight
gain of 65 gm, during the first 3 months of life.
16 of these rats were fed a new diet from birth
until age of 3 months. Their mean weight was
60.75 gm. If the population variance is 10 gm ,
is there a reason to believe at the 5% level of
significance that the new diet causes a change
in the average amount of weight gained
Example rats
1. H0: m=65 H1: m≠65 This is a 2-Tailed test

2. a=0.05
X - μ0
3. Z 
s/ n

4. Reject H0 if z > 1.96 or if z < -1.96


X - μ 0 60.75  65
Z   5.38
5. s/ n 10 / 16

6. Since -5.38 <-1.96, we Reject H0. There is a statistically significant evidence


at a=0.05 to show that the mean weight of sample is different than the main
breed, and weight gain was due to the new diet. The chance that the sample
and the population means are different due to chance only is less than 5%.
Hypothesis Testing for p
• The previous example was on a continuous
data, how about discrete data?
– The outcome is dichotomous (Yes, No)(Success,
Failure)
– The H0: p=p0 and H1: p>p0, p<p0, p≠p0
– Test Statistic
p̂ - p 0
Z
p 0 (1 - p 0 )
n
Example _ Framingham 2
The NCHS reports that the prevalence of
cigarette smoking among adults in 2002 is
21.1%. However, among 3536 participants in
the Framingham Heart Study, 482 reported
smoking. Is the prevalence of smoking lower
among participants in the Framingham Heart
Study? a= 0.05
Example _ Framingham 2
1. H0: p=0.211 H1: p<0.211 This is a one-Tailed test

2. a=0.05
p̂ - p 0
Z
3. p 0 (1 - p 0 )
n

4. Reject H0 if z < -1.645


p̂ - p 0 0.136  0.211
Z   10.93 Using Z-table, P<0.0001
5. p 0 (1 - p 0 ) 0.211(1  0.211)
n 3536

6. Since -10.93 <-1.645, we Reject H0. There is a statistically significant evidence at


a=0.05 to show that the prevalence of smoking is lower among the Framingham
Heart Study participants. The chance that the Framingham participants and the
population means are different due to chance only is less than 5% (p<0.0001).
Example Weight
Salem believes that his “true weight” is 72kg with a standard
deviation of 3kg.

Salem weighs himself once a week for four weeks. The average
of these four measurements is 75.4kg.

Are the data consistent with Salem’s belief?


Example Weight
1. H0:  =72 H1:  >72 This is a one tail test

2. a=0.05

3.  > 72 (one tail test)

4. Reject H0 if z > 1.645


X - μ 0 75.4  72
Z  2.26 P ( Z  2.26) .012
5. s/ n 3/ 4

6. Since 2.26 >1.645, we Reject H0. There is a statistically significant evidence


at a=0.05 to show that the mean weight measured is higher than his original
belief about his weight. The chance that the measured weight and initial
(belief) weight means are different due to chance only is less than 5%.
Example Weight illustrated

z = 75.4-72 = 2.26
3
Reject H0
4
0.01

x = 72
x= 1.5 75.4

0 1.65 2.26
Zcrit Ztest
Confidence Intervals
• CI = Interval that contain the sample statistics
gained to estimate a population parameter.
• A powerful statistics to support your findings.
• In todays world, CI are required to report in
statistical results that’s meant for publication.
• It’s a percentile in the normal distribution
curve. So what’s percentile?
Percentiles of the Normal Distribution

The kth percentile is defined as the score that holds k


percent of the scores below it.

Eg., 90th percentile is the score that holds 90% of the scores
below it.

Q1 = 25th percentile, median = 50th percentile, Q3 = 75th


percentile
Percentiles

For the normal distribution, the following is used to compute


percentiles:
X=m+Zs
where
m = mean of the random variable X,
s = standard deviation, and
Z = value from the standard normal distribution for the desired
percentile (See Table 1A).
Percentiles
Percentiles of the Standard Normal Distribution
Percentile Z
1st -2.326
2.5th -1.960
5th -1.645
10th -1.282
50th 0
90th 1.282
0.95
95th 1.645 0.05

97.5th 1.960 0
-4 -3 -2 -1 0 1 2 3 4

99th 2.326 1.645


Example 5.12.
Percentiles of the Normal Distribution
BMI in men follows a normal distribution with
m=29, s=6. BMI in women follows a normal
distribution with m=28, s=7.

The 90th percentile of BMI for men:


X = 29 + 1.282 (6) = 36.69.
The 90th percentile of BMI for women:
X = 28 + 1.282 (7) = 36.97.
Compute the 10th and the 99th percentiles
Confidence Intervals (CI)
• A range of possible mean values within which μ is likely to be
contained a given % of the time.
CI = statistic ± Z Critical value * (standard deviation)
CI = X ± (Z cv) (σ / √N)
• As the CI gets wider,
– the more likely of being right
– the less precise the prediction
• Confidence and precision are constantly traded off
– 99% CI is broader and more certain, but less precise than 95%
CI (if other conditions are kept constant)
– The larger the sample size, the narrower becomes the CI (the
more precise the prediction)
Example Confidence Interval
In a rehabilitation center for drug abuse, staff found
that drug abusers need few months to rehabilitate.
Further investigation for 36 clients found that the
average number of days for a complete cessation of
drug use is 90 days. However, variation for drug use
cessation was high (12 days) among individuals.
• Compute the 95% Confidence interval for the
means, what is your interpretation on the interval?
Example Confidence Interval
• Remember SE= σ / √N, therefore SE= 12/√36= 2
• Lower limit of the 95%
90 - (1.96)(2) = 86.08
• Upper limit of the 95%
90 + (1.96)(2) = 93.92
CI ={86.08, 93.92}.
What’s your 95% statement of confidence?

You might also like