Download 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

Probability wikipedia , lookup

History of statistics wikipedia , lookup

Foundations of statistics wikipedia , lookup

Statistics wikipedia , lookup

Transcript
Fundamentals of Data
Analysis
Lecture 4
Testing of statistical
hypotheses
pt.1
Program for today
Statistical
hypothesis;
Parametric (standard) tests;
Nonparametric (distribution free) tests.
Statistical hypothesis




While attempting to make decisions some
necessary assumptions or guesses about the
populations or statements about the
probability distribution of the populations
made are called statistical hypothesis.
These assumptions are to be proved or
disproved
A predictive statement usually put in the form
of a null hypothesis and alternate hypothesis
Capable of being tested by scientific
methods, that relates an independent
variable to some dependent variable
Testing of statistical
hypotheses


.
Researcher bets in advance of his
experiment that the results will
agree with his theory and cannot be
accounted for by the chance
variation involved in sampling
Procedures which enable researcher
to decide whether to accept or reject
hypothesis or whether observed
samples differ significantly from
expected results
Testing of statistical
hypotheses






Plan & conduct experiment so that if the
results are not explained by the chance
variation, theory is confirmed
Collect data
Set null hypotheses i.e. assume that results
are due to chance alone
Use a theoretical sampling distribution
Obtain probability of sample data as if it is
chance variation
If probability at 5 is less than some
predetermined small percentage (say 1% or
5%) reject the null hypothesis and accept the
alternate hypothesis
Procedure for
hypothesis testing






Plan & conduct experiment so that if the
results are not explained by the chance
variation, theory is confirmed
Collect data
Set null hypotheses i.e. assume that results
are due to chance alone
Use a theoretical sampling distribution
Obtain probability of sample data as if it is
chance variation
If probability at 5 is less than some
predetermined small percentage (say 0.1%,
1% or 5%) reject the null hypothesis and
accept the alternate hypothesis
Type I and type II errors
 The first kind of error that is possible involves the
rejection of a null hypothesis that is actually true.
This kind of error is called a type I error, and is
sometimes called an error of the first kind.
 The other kind of error that is possible occurs
when we do not reject a null hypothesis that is
false. This sort of error is called a type II error,
and is also referred to as an error of the second
kind.
Type I and type II errors
 Error is determined in advance as level of
significance for a given sample size
 If we try to reduce type I error, the probability of
committing type II error increases
 Both type errors cannot be reduced
simultaneously
 Decision maker has to strike a balance / trade off
examining the costs & penalties of both type
errors
Null (H0) & Alternative
(Ha) hypotheses
H0 - while computing two methods
assuming that both are equally
good
Ha - a set of alternative to H0 or
rejecting the H0 (what one
wishes to prove)
The level of significance
 Some percentage (usually 5%) chosen with
great care, thought & reason so that how will
be rejected when the sampling result
(observed evidence) has a probability of <
0.05 of occurring if H0 is true
 Researcher is willing to take as much as a 5%
risk of rejecting H0
 Significance level is the maximum value of
the probability of rejecting H0 when it is true
 It is usually determined in advance, I.e., the
probability of type I error (α) is assigned in
advance and hence nothing can be done
about it
Parametric tests
Parametric tests allow you to make a number of
requests for various statistical parameters.
Examination of phenomena by calculating the
parameters is a very effective way to learn, this is
due to a concise and accurate form of the
description.
Parametric tests, despite its diversity, do not give
answers to all the important questions, mainly
because these tests can be applied if the tested
quantity (the population) has normal distribution or
very close to it. In addition, parametric tests, as the
name suggests, describe a property of the
phenomenon under study (test results), without
giving sufficient grounds to formulate general
conclusions.
Student's t test
 It is based on t-distribution and only
incase of small samples
 Used for testing difference between
means of two samples, coefficient of
simple & partial correlations, etc
 Using this test, we can test the null
hypothesis as:
H0 : m = m0
while the alternative hypothesis is as
follows:
H1: m  m0
Student's t test
In fact very few know the mean value and standard
deviation of the general population, so we must be
satisfied with estimate value using most frequently
applied estimators - the average of the sample :
1 n
x   xi
n i 1
and standard deviation inside the sample calculate with
the aid of equation:
1 n
xi  x 2
s

n  1 i 1
Student's t test
We must calculate the statistics:
t
xm
s/ n
which has the Student’s t distribution with n - 1
degrees of freedom (n – number of samples),
provided that the population is normal or very
close to it.
Student's t test
So, if you want to check the null hypothesis of
equality of the mean value for the sample with the
average for the population, we use the Student's tdistribution tables and for ithe assumed level of
confidence and read the critical value ta, such that:
Pt  ta   1  a
Now compare this value t with the critical value ta
and if:
 |t|  ta then reject the null hypothesis;
 |t| < ta then there is no reason to reject the null
hypothesis.
Student’s t test
Example
We know that the average light time of the
bulb is m0 = 1059 hours. After making changes
in the technology decided to see if these
changes have not shortened the light time.
The null hypothesis is therefore of the form H0
: m1 = m0, ie: the average burn time has not
changed bulbs. For testing random sample of
10 light bulbs was taken, the results of these
studies are presented in Table.
Student’s t test
Example
 xi  x 
 xi  x  2
1015
-33
1089
1017
-31
961
1045
-3
9
1058
10
100
1147
99
9801
987
-61
3721
1295
247
61009
1054
6
36
884
-164
26896
978
-70
4900
10480
0
108522
Czas
pracy żarówki
Lighting
time
x [h]
Student’s t test
Example
10480
x
 1048h
10
1 n
108522
2
xi  x  
s
 109.8

n  1 i 1
9
1048  1059
t
10  0,317
109.8
Read from the tables for a confidence
level 0.95 critical value ta = 1.833,
therefore there is no reason to reject the
null hypothesis.
Student’s t test
Exercise
12 farms was independently drawn in a village and the
following values ​of crops of oats was obtained for them:
23.3, 22.1, 21.8, 19.9, 23.7, 22.3, 22.6, 21.5, 21.9, 22.8,
23.0, 22.2
At the level of significance of 5% test the hypothesis that
the value of the average yield of oats in the whole village
is 22,6 q/ha, alternative hypothesis is that the value of
the average yield of oats is higher.
Chi-square test
Test of variation of the general population
To perform the test one should:
1. Calculate the mean value and the
standard deviationa according equation:
n
1
s 2   xi  x 2 ;
n 1
2. Calculate value of chi-square statistics:
 2  n s 2 /  o2
Chi-square test
3. For level of confidence a and degree of freedom k
= n - 1 we must find in tables of chi-square
distribution the critical value that satisfies the
equation:


P  2  a2  1  a .
Inequality 2  a2 defines right-hand critical area.
When during comparison of calculated value with the
critical value we obtained that 2  a2 the null
hypothesis should be rejected. Otherwise, there is no
reason to reject the null hypothesis.
Chi-square test
Example
11 independent measurements
were made of cast pipe diameter and
following results were obtained:
50.2, 50.4, 50.6, 50.5, 49.9, 50.0,
50.3, 50.1, 50.0, 49.6, 50.6 mm
At confidence level α = 95% we
should test the hypothesis that the
variance of the obtained diameter of
the pipes is equal to 0.04 mm
Chi-square test
Mean value:
Example
x  50.2
Standard deviation:
s  0.3162
The hypothetical value of the
variance
  0.04
2
0
Chi-square test
Chi-square statistics is equal:
Example
11 0.3162
2
 
 27.5
0.04
Critical value for degree of freedom
equal to k=n-1=11-1=10:
2
a  18,307
2
so the critical value read from the
tables is less than calculated one,
therefore, the null hypothesis should
be rejected.
Chi-square test
Exercise
In order to verify the accuracy of the
measuring instrument 6 measurements
were made of the same quantity and the
following values ​were obtained:
1.017, 1,021, 1.015, 1.019, 1.022, 1.019
The measurements are normally
ditributed.
At the confidence level α = 99% verify the
hypothesis that the variance of the
measurements is equal to 0.001
To be continued … !