You are on page 1of 8

3/6/2018

HYPOTHESIS TESTING (I)


BIOSTATISTICS - PIC OF THE DAY! Z-TEST & ONE-SAMPLE T-TEST
HLSC 2P07
Winter 2018

Dr. Divya Joshi, Ph.D.


Department of Health Sciences
Brock University
1 2
Email: djoshi@brocku.ca
Room: AS 345
Office Hours: Friday 2:00-4:00 pm

LAST WEEK… Theoretically, when monohybrid peas with green


pods were crossed with monohybrid peas with
Any random sample can be used to calculate a yellow pods, 25% of peas would be expected to
point estimate of population proportion have yellow pods. If you saw 26.2% of 580 offspring
peas were with yellow pods, can you conclude that?
The larger sample size will provide a more
1. The theory is not right because the peas with yellow
precise range (CI) in which the population pods is more than expected
proportion is located
2. The theory is right because the difference between
the expected and the actual one is close
With a small margin error E, one needs a
larger sample size to estimate the population 3. It is uncertain whether the theory is right or not at
proportion at 1-α confidence level 3
the moment 4

BUILDING STATISTICAL MODELS STATISTICAL HYPOTHESIS TESTING


When answering research questions
We may find differences between groups
Or relationships between variables
Examples?
There are different explanations for these…

Need to use statistical hypothesis testing


5 6

1
3/6/2018

HYPOTHESIS 1. NULL HYPOTHESIS


Hypothesis: is a claim or statement about A statement that the value of a
the population parameter population parameter is equal to some
claimed value
- Statistical hypothesis testing is a procedure for
testing this claim Implies no difference
- Made to establish a testable condition
- May or may not be true
- 2 hypotheses are required
H0: There is no (association, difference,
relationship, etc…) between …..
7 8

2. RESEARCH/ALTERNATIVE HYPOTHESIS TAILS


The statement that the parameter has a value that Two tailed test: The critical region is in the two
somehow differs from the null hypothesis extreme regions (tails) under the curve
Hypothesis is written as: H1 ≠ …
Statement of what must be true if the null
hypothesis is false Recall: What
percent of area lies
with ±2 standard
H1: If H0 is not true, then the alternative must be deviations?

that there is an (association, difference,


relationship, etc…), between …….

9 10

TAILS EXAMPLES OF HYPOTHESIS


1. The proportion of peas with yellow pods is equal to 0.25
One tailed test:
Right-tailed test: The critical region is 2. The mean height of adult males is greater than 183 cm
in the extreme right region (tail)
3. Based on an observational study with data collected
under the curve
from a random sample, the prevalence of autism
Hypothesis is written as: H1 > … spectrum disorder is 21% among children born very
Left-tailed test: The critical region is prematurely, which is roughly three times higher than
in the extreme left region (tail) under that among children (population) born normally
the curve
Hypothesis is written as: H1 < … 4. A study found that children from families that had home
renovations during the past year had elevated blood
Is it better to do a one-tail test or a two-tail test? lead level (70 umol/L). The safe blood lead levels in the
11 12
Note: Always use equal symbol (=) when writing H0 children population should be less than 10 umol/L.
but < or > or ≠ in H1

2
3/6/2018

CRITICAL REGION, SIGNIFICANCE LEVEL, & CRITICAL VALUE TYPE I AND TYPE II ERRORS
Critical region: The set of all values of the test Type I error - occurs when we believe that there
statistic that cause us to reject the null hypothesis is a genuine effect in our population, when in
fact there isn’t.
Significant level (α): The probability that the test The probability is the α-level (usually .05)
statistic will fall in the critical region when null
hypothesis is actually true Type II error - occurs when we believe that
there is no effect in the population when, in
reality, there is.
Critical value: Any value that separates the critical
The probability is the β-level (often .2)
region from the values of the test statistic that do
not lead to rejection of the null hypothesis 13 14

THE POWER SIGNIFICANCE


Is a probability/chance to reject a false null Findings must be due to something other
hypothesis than chance alone
But how do we know if the difference or
Which factors affect power?
relationship is significant?

15 16

P-VALUE EFFECT SIZE


The probability of getting a value of the test A standardized measure of the size of
statistic that is at least as extreme as the one an effect:
representing the sample data, assuming that Standardized = comparable across
the null hypothesis is true studies
Not (as) reliant on the sample size
Helps you determine if your results are
Allows people to objectively
significant evaluate the size of observed effect
All hypothesis tests ultimately use a p-value to
weigh the strength of the evidence Effect size measures?
17 18
What does a p-value of 0.01 indicate?

3
3/6/2018

4 STEPS OF HYPOTHESIS TESTING 3 METHODS TO MAKE A CONCLUSION


1. Hypothesis, Tail, and Significance Level Test statistic > critical value

2. Test statistic and its calculation P-value < significance level (α = 0.05)

3. Determine if the calculated statistic is significant


Confidence interval includes the likely value of
the parameter
4. Conclusion - reject or fail to reject H0

19 20

TESTING A CLAIM ABOUT ONE SAMPLE Example – Genetic Experiment


PROPORTION
An experiment involving peas resulted in 580 offspring,
Requirements: with 26.2% of the offspring peas having yellow pods.
1. The sample observations are a simple random sample Mendel claimed that the proportion of peas with yellow
2. The conditions for a binomial distribution are satisfied pods should equal 25%
3. The conditions np ≥ 5 and nq ≥ 5 are both satisfied
̂ −
Test statistics: =

n = sample size or number of trials


̂ = x/n (sample proportion)
21
p = population proportion (used in the null hypothesis) 22

q=1-p

Is this hypothesis true?


Is this sample from this population?
2. Assumption Check & Test Statistic

A sample of Normal as an approximatation to Binomial


Hypothesis:
n = 580 25% yellow pods np = 580*0.25 = 145 ≥ 5
26.2% in population nq = 580*0.75 = 435 ≥ 5

Identify the following: ̂ −


=
n= Ơ =√ (0.25 x 0.75)/580 = 0.018
̂=
p=
. .
1. What is H0 & H1? Significance level? = = 0.67
23
. ∗ . 24

4
3/6/2018

4. Conclusion
3. Determine if the calculated z is significant (Table A-2)
H0: P = 0.25
Using p-value: H1: P ≠ 0.25

P (z > 0.67) = 1 – P(z < 0.67) = 1 – 0.7486 = 0.2514 p-value: 0.5028 > α = 0.05
P = 2*0.2514 = 0.5028 > α = 0.05 critical value: 0.67 < 1.96 not in the rejection

Using critical value for 95% CI, 2 tail test: Fail to reject the null hypothesis. It is possible to have
26.2% of peas with yellow pods from a population
0.67 < 1.96 not in the rejection
that 25% of peas with yellow pods.

25 26

USING CI TO EXAMINE H0 USING CI TO EXAMINE H0


∗ . ∗ .#$%
= / E = 1.96 A sample of Hypothesis:
%
n = 580 25% yellow pods
E = 0.036 26.2% in population

-E<P< +E 95% CI: (0.226, 0.298)


When 95% confidence interval derived from a random sample
95% CI: (0.226, 0.298) includes the hypothesized parameter (e.g., p=0.25) the null
hypothesis (H0: p=0.25) is not rejected
27 28
However, if the 95% CI doesn’t include the hypothesized
parameter, the null hypothesis then is rejected

TESTING A CLAIM ABOUT A ONE POPULATION MEAN TESTING A CLAIM ABOUT A MEAN: & KNOWN
Which Method to use? Requirements:
A simple random sample
Normal dist?
The value of the population SD - & is known
yes no The population is normally dist. or n>30
& known? n>30 ?
yes
Test statistic ,1 − 2
Z-method
no
no
0= &
yes

,- = sample mean
t-method
x-µ
z= µ = Population mean
σ/√n .
Nonparameter methods = standard error
x-µ 29 / 30
t=
s/√n

5
3/6/2018

Example: Population of human body temperatures Null & alternative hypothesis?


Is this hypothesis true?
Tail of test and significance level?
Is this sample from this population? What type of test is this?
Hypothesis:
Test statistic?
A sample of
n = 106 µ = 98.6 oF
,- = 98.20 oF σ = 0.62 oF
In population

Test the claim if the sample mean is significantly


different from the population mean
Find the probability of getting a mean of 98.6oF or lower
31 32

,1 − 2 98.2 − 98.6 Margin of Error


0= & 0=
0.62
106
Confidence interval
Z = -6.64
critical value zα/2 = -1.96

P(z= -6.64) < 0.0001

Since the test statistic z = -6.64, which is located in the


rejection region and the p-value is much less than
α=0.05 (< 0.0001), the null hypothesis is rejected 33 34

TESTING A CLAIM ABOUT A MEAN: & NOT KNOWN Example: Population of human body temperatures
Requirements:
Is this hypothesis true?
A simple random sample Is this sample from this population?
The value of the population SD - & is not known A sample of Hypothesis:
The population is normally dist. or n>30 n = 12 µ = 98.6 oF
,- = 98.39 oF σ = not known
Test statistic s = 0.535 In population
,1 − 2
;= < Test if the sample mean is significantly less than the
population mean
Find the probability of getting a mean of 98.2oF or lower
s = sample SD 35 36

6
3/6/2018

Test statistic
Null & alternative hypothesis?
Tail of test and significance level? ,1 − 2 98.39 − 98.6
;= ;=
< 0.535
What type of test is this?
12
Test statistic?
t = -1.36

d.f. = 11, the critical value = -1.796

37 38

Finding p-value

39 40

What would the critical value be for a two-tail test?

MARGIN OF ERROR & CONFIDENCE INTERVALS SAS - TESTING A CLAIM ABOUT A MEAN: & NOT
KNOWN (One Sample t-test)
Two-Tailed One-Tailed
Test Test Mean weight in population is 62 kgs. Is there a
Significance Level 0.01 99% 98% significant difference in mean weight between the
0.05 95% 90% sample and the population?
0.10 90% 80%
What type of a test is this? Hypothesis, Requirements…?
90% CI: (98.11, 98.67)
Conclusion?
Conclusion:
Population mean of 98.6 is contained with the CI 41 42

so we fail to reject the null hypothesis

7
3/6/2018

HOMEWORK
Chapter 8
8.2 - # 8, 16, 20, 22, 26, 32, 38
8.3 - # 2, 16
8.4 - # 6, 12
8.5 - # 4, 10, 20

Conclusion?
43 44

You might also like