Download introduction to hypothesis tests

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Bootstrapping (statistics) wikipedia , lookup

Psychometrics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Taylor's law wikipedia , lookup

Omnibus test wikipedia , lookup

Statistical hypothesis testing wikipedia , lookup

Misuse of statistics wikipedia , lookup

Resampling (statistics) wikipedia , lookup

Student's t-test wikipedia , lookup

Transcript
HYPOTHESIS TESTING
1
Introduction
The purpose of hypothesis testing is to determine
whether there is enough statistical evidence in favor
of a certain belief about a parameter
And to permit generalizations from a sample to the
population from which it came.
The word hypothesis is just slightly technical or
mathematical term for “sentence” or “claim” or
“statement”. In statistics, a hypothesis is always a
statement about the value of one or more population
parameter(s).
2
Hypothesis: A statement that something is true
concerning the population.
Typical statistical hypotheses are:
µ>5 cm P0.65
2>2.00
µ1-µ2>0 and so on.
The following are not statistical hypothesis
“ x  5“ because x is not a population parameter (it
is a sample statistic)
“µ is big enough” because though it is a statement
about the population parameter µ,
the statement is not quantitative.
3
There are two hypotheses (about one or more
population parameter(s))
H0 - the null hypothesis
H1 - the alternative hypothesis
The hypothesis testing is the operation of deciding
whether or not data obtained for a random sample
supports or fails to support a particular hypothesis.
The statistical
procedure.
hypothesis
test
is
a
five-step
The first two steps of the hypothesis test procedure
are to formulate two hypothesis.
4
STEP 1 Formulate the null hypothesis
Null Hypothesis, H0: The hypothesis upon which we
wish to focus our attention. Generally this is a
statement that a population parameter has a
specified value.
STEP 2
Formulate the alternative hypothesis
Alternative Hypothesis, Ha: A statement about the
same population parameter that is used in the null
hypothesis. Generally this is a statement which
specifies that the population parameter has a value
different from the value given in the null hypothesis.
One-sided
Two-sided
H0: =  0
H0: =  0
H0: =  0
Ha:   0
Ha: >  0
Ha:  <  0
5
At the conclusion of the hypothesis test, we will reach
one of two possible decisions. We will decide in
agreement with null hypothesis and say that we fail to
reject H0. Or we will decide in opposition to null
hypothesis and say that we reject H0.
6
There are four possible outcomes that could be
reached as a result of the null hypothesis being either
true or false and the decision being either “fail to
reject” or “reject”.
Null Hypothes is
Decision
True
False
Accept H0
Correct Decision
(1- α)
Type II Error
β
Reject H0
Type I Error
α
Correct Decision
(1- β)
7
a = P(commit a type I error) = P(reject H0 given that H0 is true)
 = P(commit a type II error) = P(accept H0 given that H0 is false)
Accept H0
Reject H0
8
STEP 3
Determine the test criteria.
Test Criteria: Consist of
1. determining a test statistic,
2. specifying a level of significance a
3. and determinig the critical region.
Test Statistic: A random variable whose value will be
used to make the decision “fail to reject H0” or “
reject H0”
Critical Region:The set of values for the test statistic
that will cause us to reject the null hypothesis.
Critical Value is the first value in the critical region.
Level of significance: The probability of committing
9
the type I error, a.
STEP 4
Obtain the value of the test statistic.
The test statistic is some statistic that may be
computed from the data of the sample. The test
statistic serves as a decision maker, since the
decision to reject or not to reject the null hypothesis
depends on the magnitude of the test statistic. An
example of a test statistic is the quantity
xi  
z

x
z
 n
10
STEP 5
Make a decision and interpret it.
Decision Rule: If the test statistic falls within the
critical region, we will reject H0.
If the test statistic does not fall in the critical region,
we will fail to reject H0.
The set of values that are not in the critical region is
called the acceptance (noncritical) region.
11
Example
Researchers are interested in the mean level of some
enzyme in a certain population. They take a sample of
10 individuals, determine the level of enzyme in each
and compute a sample mean 22. It is known that the
variable of interest is approximately normally
distributed with a variance of 45. Let us say that they
are asking the following question: Can we conclude
that the mean enzyme level in this population is
different from 25?
Step1-2 H0: = 25
Ha:  25
12
Step 3
Since we are testing a hpothesis about a
population mean, we assume that the population is
normally distributed, and the population variance is
known, our test statistic is z.
Let us say that we want the probability of rejecting
a true null hypothesis to be a=0.05. Our rejection
region is to consist of two parts. It seems
reasonable that we should divide a equally and let
a/2=0.025 be associated with small values and
a/2=0.025 be associated with large values.
13
Step 4
z
x 

n

22  25
45 / 10
 1.41
Step 5
a/2=0.025
a/2=0.025
rejection region
acceptance region
1.96
0
-1.96
-1.41
0.95
rejection region
Step 6 Accept H0. We conclude that the mean enzyme
level in this population is not different from 25
14
Example
Suppose, instead of asking if they could conclude that
 25, the researchers had asked: Can we conclude
that the mean enzyme level in this population is less
than 25?
Step1-2
H0: = 25
Ha: < 25
15
Step 3
Since we are testing a hpothesis about a
population mean, we assume that the population is
normally distributed, and the population variance is
known, our test statistic is z.
Let us say that we want the probability of rejecting
a true null hypothesis to be a=0.05. We will want
our rejection region is to be where the small values
are –at lower tail of the distribution. This time, since
we have a one-sided test, all of a will go in the one
tail of the distribution.
16
Step 4
z
x 

n

22  25
45 / 10
 1.41
Step 5
a=0.05
-1.645
-1.41
0.95
rejection region
0
acceptance region
Step 6 Accept H0. We conclude that the mean enzyme
level in this population is not less than (greater than
17
Hypothesis Testing
Parametric Tests
Nonparametric
Tests
• Sampling should be random.
• Population should be distributed normally.
• Variables sholud be continuous.
• # of observations should be greater than
10.
• No assumption on the distribution of the
population.
•No assumption on the type of the variable.
• No assumption on the # of observations.
18
Non parametric tests are used as an alternative to
parametric tests. Usually are used when the distribution
of underlying population is nonnormal.
Even the underlying population is normally distributed
if the sample size is small (n<10), again
nonparametric tests are used.
While parametric tests are used to test the
hypothesis based on population mean, proportion
and standard deviation,nonparametric tests are used
to test the hypothesis based on median or
distribution of samples.
19
HYPOTHESIS TESTING:
ABOUT A SINGLE
POPULATION
20
A SINGLE POPULATION MEAN
INTRODUCTION
In this lecture we consider the testing of hypothesis
about a population mean under three different
conditions:
1. When sampling is from a normally distributed
population of values with known variance,
2. When sampling is from a normally distributed
population of values with unknown variance,
3. When sampling is from a population that is not
normally distributed.
21
When  is known and n is
large
When  is unknown and n is
small (n30)
x
z
 n
x
t
s n
If the population that we are sampling is approximately normal
and n30, we will base our procedures on Student’s t
distribution. Student’s t distribution is the distribution of t
statistic. When n>30, t distribition approaches to the normal
distribution.
22
Properties of t Distribution:
1. t is distributed with a mean of 0.
2. t is distributed symmetrically about its mean.
3. t is distributed with a variance greater than 1, but as the
sample size n increases, the variance approaches to 1
4. t is distributed so as to be less peaked at the mean and
thicker at the tails than the normal distribution.
5. t is distributed so as to form a family of distributions, a
separate distribution for each sample size. The t
distribution approaches to the normal distribution as the
sample size increases.
23
Normal Distribution
Student’s t, n=10
Student’s t, n=2
0
24
Example Researchers collected serum amylase values
from a random sample of 15 apparently healty
subjects. The mean and standard deviation computed
from the sample are 96 and 35 units/100 ml,
respectively. They want to know whether they can
conclude that the mean of population from which the
sample of serum amylase determinations came is
different from 120.
Hypothesis H0: = 120
Ha:  120
Test
statistic
Since the population variance is unknown,
our test statistic is t
Level of significance a=0.05
25
t
x 
s n

96  120
35 15
 2.65
t(a/2,n-1)= t(0.025,15-1)=2.14
a/2=0.025
a/2=0.025
0.95
2.65 2.14
Reject H0
0
2.1
4
Accept H0
Reject H0
26
t Distribution Table
Amount of a in two-tail
df.
0.20
0.01
0.05
0.025
0.01
Amount of a in one-tail
0.40
0.20
0.10
0.05
0.02
1
1.376
3.078
6.314
12.706
31.821
2
1.061
1.886
2.920
4.303
6.965
...
...
...
...
...
...
30
0.854
1.310
1.697
2.042
2.457
40
0.851
1.303
1.684
2.021
2.423
...
...
...
...
...
...
120
0.845
1.289
1.658
1.980
2.358
...
...
...
...
...
...
0.842
1.282
1.645
1.960
2.326
Sonsuz
27
THE SIGN TEST
When the normality assumptions can not be made or
when the data at hand are ranks rather than
measurments on an interval or ratio scale, an
alternative test must be sought.
A frequently used nonparametric test does not
depend on the assumptions of the t test, or
measurement beyond the ordinal scale is the sign
test.
This test focus on the median rather than the mean
as a measure of central tendency or location.
28
The sign test gets its name from the fact that pluses
and minuses, rather than numerical value, provide the
raw data used in the calculation.
The null hypothesis to be tested concerns the
value of the population median M.
H0: Population median is M0. (M=M0)
HA: Population median is not M0. (MM0)
The data converted to (+) and (-) signs
A plus sign will be assigned to each piece of data
larger than M0, a minus sign to each piece of data
smaller than M0 and the zero to those data equal
M0
29
The sign test uses only the plus and minus signs.
When n < 25, the sign test table are used
where k is the number of the less frequent sign and
n is number of observations.
Reject the null hypothesis whenever the number of the
less frequent sign is extremely small.
When n  25
Accept H0
Reject H0
p<a
z  za
or
p < a/2
or z
n
k 
2
z 
n /2
 za / 2
p> a
or
p > a/2
Otherwise
30
Example: Researchers wished to know if instruction in
personal care and grooming would improve the appearance of
mentally retarded girls. In a school for the mentally retarded,
10 girls selected at random received special instruction in
personal care and grooming. Two weeks after completion of
the course of instruction the girls were interwieved by a nurse
and a social worker who assigned each girl a score based on
her general appearance. We wish to know if we can conclude
that the median score of the population from which we
assume this sample to have been drawn is different from 5.
Girl
1
2
3
4
5
6
7
8
9
10
Score 4
5
8
8
9
6
10 7
6
6
31
H0: The population median is 5.
HA: The population median is not 5.
Girl
1
2
3
4
5
6
7
8
9
10
Score
4
5
8
8
9
6
10
7
6
6
-
0
+
+
+
+ +
+
+
+
<5
=5
>5
>5
>5
>5 >5
>5
>5
>5
Since # of (-)=1
and # of (+)=8
and # of (0)=1;
k=1, n=10-1=9
32
From the sign test table p=0.0195
Since p<0.025, we reject H0.
We conclude that the median score is not
5.
33
A SINGLE POPULATION PROPORTIO
The proportion or the percentage of a population and
the probability associated with the occurence of a
particular event all involve the binomial parameter p.
Recall that p was defined to be the theoretical or
population probability of success on a single trial in a
binomial experiment.
Testing hypotheses about population proportions is
carried out in much the same way as for means
when the conditions necessary for using the normal
curve are met.
34
The mean of x is np, thus the mean of p, p should
be np/n=p
Standard error of p
 p  npq n  pq n
An observed value of p belongs to a sampling distribution
that
• is approximately normal
• has a mean
p
p
, equal to p
• has a standard error
z
pq n
, equal to
pP
PQ / n
35
Example Suppose we are interested in knowing what
proportion of automobile drivers regularly wear sealt
belts. In a survey of 300 adult drivers, 123 said they
regularly wear seat belts. Can we conclude that from
these data that in the sample population the proportion
who regularly wear belts is not 0.50?
H0: p=0.50
p=123/300=0.41
HA: p0.50
z
pP
PQ / n

0.41  0.50
(0.50)(0.50) / 300
 3.11
Critical z values are -3.11<-1.96  Reject H0.
1.96
We conclude that in the population the proportion
who regularly wear belts is not 0.50.
36
ONE SAMPLE CHI SQUARE TEST
There are many problems for which the information is
categorized and the results are shown by the way of
counts.
Suppose that we have a number of celss into which n
observations have been sorted. The observed
frequencies in each cell are denoted by O1, O2, O3,
..., Ok. Note that the sum of all observed frequencies
is equal to O1+ O2+ O3+ ...+ Ok=n
What would like to do is to compare the observed
frequencies with some expected or theoretical
frequencies, denoted by E1, E2, E3, ..., Ek, for each
of these cells. Again, the sum of these expected
frequencies must be exactly E1+ E2+ E3+ ...+ Ek=n37
We will decide whether the observed frequencies
seem to agree or seem to disagree with the expected
frequencies. This will be accomplished by a
hypothesis test using the chi-square distribution, 2.
The calculated value of the test statistic will be
2
(
O

E
)
i
2   i
Ei
i 1
k

2
( df k 1,a )
   reject H 0
2
38
Chi-square table
a
df
0.05
0.01
0.001
1
3,841
6,635
10,827
2
5,991
9,210
13,815
3
7,815
11,340
16,268
...
...
...
43,770
50,890
59,703
30
39
wearing
sealt belts
Observed Expected (O-E) (O-E)2 (O-E)2/E
Yes
123
150
-27
729
4.86
No
177
150
27
729
4.86
Total
300
300
0
9.72
H0: The proportion of drivers wearing sealt belts is
equal to 0.50.
HA: The proportion of drivers wearing sealt belts is
not equal to 0.50.
2
(
O

E
)
i
2   i
 9.72
Ei
i 1
2

2
(1, 0.05)
 3.84    reject H 0
2
40