You are on page 1of 40

STATISTICAL ANALYSIS FOR

EXPERIMENTAL DESIGN AND DATA


PROCESSING

Prof. Mustafa Sait YAZGAN


Assoc. Prof. Alpaslan EKDAL

1
Statistical Hypothesis Testing

Hypothesis tests for parameters

It is known that the true value of a parameter of a random


variable can never be known as its population cannot be
observed entirely. Sometimes we make a statistical hypothesis
such that the value of a parameter  equals 0 a value chosen
by us.

2
Statistical Hypothesis Testing

Hypothesis tests for parameters

The procedure of checking whether this value can be accepted


is called the testing of the hypothesis =0 ( is any parameter
of the population of the random variable, such as the mean,
standard deviation,…., 0 is a value we have chosen for the
parameter in the particular problem we are concerned with).

3
Statistical Hypothesis Testing

We can test a hypothesis only by comparing the value of 0 with


b, the value of the statistic corresponding to the parameter ,
that we have computed from a sample. Obviously, we cannot
simply decide that the hypothesis is false when b is not equal to
0. It is possible that the value of b estimated from the sample is
somewhat different from the assumed value 0 because of the
sampling distribution, although  is in fact equal to 0.

4
Statistical Hypothesis Testing

We must accept the hypothesis if the value of b is not too far


from 0. How large should the difference between b and 0 be
for rejecting the hypothesis? An exact answer to this question
cannot be given because we cannot expect to be correct all the
time. However, we should use a systematic approach in testing
the statistical hypothesis to standardize the procedure.

5
Statistical Hypothesis Testing

In testing the hypothesis =0 called H0 (null hypothesis), we must first


decide about the following:

1. The alternate hypothesis H1 should be chosen. This is the hypothesis that


will be assumed to be accepted when the null hypothesis is rejected by
the test. The alternate hypothesis may have the forms H1: 0, < 0 or
>0 depending upon the structure of the problem. If our objective is
simply to check whether  equals 0 or not, we work with a hypothesis
H1:0. But when we are interested in knowing especially if  is greater
than 0 for 0 then we must test according to the hypothesis H1:>0.

6
Statistical Hypothesis Testing

1. Similarly, when we want to know if  is smaller than 0 for 0 the


alternate hypothesis should be of the form <0. For example, in
examining the strength of a material it is critical if the strength is below
a particular value, therefore the alternate hypothesis is H1:<0. On the
other hand, in working with flood flows, the exceedance of a certain
value becomes critical, and we must choose H1:>0.

7
Statistical Hypothesis Testing

2. The difference –0 that can be tolerated for accepting the hypothesis H0
is related to the level of significance «α» for which the test is performed.
Once the value of α is chosen, the sampling distribution of the statistic b
drawn with the mean 0 is divided into the regions of acceptance and
rejection. The acceptance region is near the value 0. The rejection region,
with an area equal to α (the probability of the statistic to be in this critical
region) is farther from 0. This region is either on one tail, or on both tails
of the sampling distribution, depending upon the type of the alternate
hypothesis H1.

8
Statistical Hypothesis Testing
I. Two–tailed test

If the hypothesis H0:=0 is to be checked against the hypothesis H1:0


then the null hypothesis should be rejected either when the observed value
of b is much larger or much smaller than 0. Therefore the region of rejection
is placed on both tails of the sampling distribution symmetrically. The region
of acceptance in this case is between the values of the statistic with the
exceedance probabilities of 1–/2 and /2 (Fig. 1). If the observed value of
the statistic lies in this region the null hypothesis is accepted, otherwise it is
rejected, implying that the alternate hypothesis H1: 0 is accepted.

9
Statistical Hypothesis Testing
II. One–tailed test

If the hypothesis H0:=0 is to be checked against the hypothesis H1, then the
null hypothesis will be rejected only when the observed value of b is H1:>0
(or <0), much larger (or much smaller). Therefore the critical (rejection)
region is on the right (left) tail of the sampling distribution. It is to the right of
the value of the statistic with the exceedance probability of  (or to the left
of the value of the statistic with the exceedance probability of 1–). If the
observed value of the statistic lies in this region of rejection the null
hypothesis is rejected (the alternate hypothesis H1 is accepted), otherwise H0
is accepted.

10
Statistical Hypothesis Testing

It is seen that statistical hypothesis testing helps us in deciding whether an


assumed value 0 for a parameter of a random variable can be accepted as
true by comparing it with the value of the corresponding statistic b obtained
from a sample. If their difference is not too big, then it is thought that this
can be explained as being caused by the sampling distribution and the
hypothesis =0 is accepted. However, errors are unavoidable because the
whole population can never be observed. Decisions made in hypothesis
testing can have four different relations to the unknown reality, as shown in
the following table.

11
Statistical Hypothesis Testing
It is seen that two kinds of errors may exist in the decisions made in
hypothesis testing. Type I error corresponds to the rejection of the null
hypothesis when it is in fact true. Type II error is made when we accept the
null hypothesis although it is in fact false.

Probability of type II error increases with the decrease of the probability of


type I error, .

The type II error is accepted as a non significant error and it should be


tolerated.
12
Applications

Hypothesis testing has several applications in engineering problems. As an


example, we can check whether the expected value of the strength of a
material conforms to the specifications by comparing it with the
experimental results. It is tested whether the mean of the experimental data
is significantly lower than the specified value or not. For another example,
we can check if the mean precipitation depths before and after the
construction of a reservoir are significantly different to decide about the
possible effect of reservoir construction on the precipitation.

13
Applications

In the test the result may differ according to the selected level of
significance. In practice the value of α is usually taken as 0.05 or 0.10. Such a
standard value of the significant level facilitates the transmission of
information. The reduction of the value of α decreases the probability that
an error is made (error type I) when the null hypothesis is rejected but
increases the probability of error type II.

Note: In hypothesis testing, limits (boundaries) of confidence interval (b1 and


b2) is calculated according to the population and the statistical values (mean
or standard deviation) of sample is checked whether it is within these limits.

14
Example 1

15
Example 2

16
Example 2

17
Example 2

18
Example 3

19
Example 4

20
Other Applications of t-test

t-test can also be applied for comparing the data of two different groups and for
identifying whether there’s a statistically significant difference or not between
them. Two tests are used for this purpose.

1. Comparison test
2. Paired t - test

21
Comparison Test

Comparison test can be applied to the following cases:

- To investigate the effectiveness of Medicine A and Medicine B on the patients


who have the same illness, age and gender. Some of the patients take Medicine
A and some of them take Medicine B.

- To compare the durability of products from two factories which have the same
type of manufacture.

22
Comparison Test

Steps of the test

1) Hypotheses are established

23
Comparison Test

Steps of the test

2) Critical table value is identified

𝑡𝑐 = 𝑡𝛼/2,(𝑛1+𝑛2 −2) for two tailed test

𝑡𝑐 = 𝑡𝛼,(𝑛1 +𝑛2−2) for one tailed test

24
Comparison Test

Steps of the test

3) Test statistic is calculated

25
Comparison Test

Steps of the test

4) Comparison is done

H0 is accepted

H0 is rejected

26
Comparison Test

While calculating the standard deviation of the differences of two


means ( )

27
Example 5

A test drive was conducted with fuel A on 15 motorcycles among 30


of the same brand and model. It was observed that average travel
distance with 1 L of fuel A was 25 km, and the standard deviation
was 0.5 km. When fuel B was used for the test drive on the
remaining 15 motorcycles; the average travel distance with 1 L of
fuel B was observed as 22 km, and the standard deviation was 0.4
km. At the 0.01 probability level is the travel distance gone with 1 L
of fuel A is more than fuel B?

28
Example 5

Fuel A
Fuel B

𝑡𝑐 = 𝑡𝛼,(𝑛1 +𝑛2 −2)

29
Example 5

Since th>tc (18.18>2.467) H0 is rejected, this means that the


travel distance with 1 L of fuel A is statistically significantly higher
than fuel B.

30
Paired t-Test

There’s a dependency between the data in cases where paired t-test is applied.
Twinning test is applied generally to the data from three cases.

1) Comparing the measurements of the same individual at different times.


Example: – Comparing the blood pressure measurements before and after
treatment
– Comparing the prices of same products at different stores

2) Comparing the results of different applications conducted on two halves of


whole.
Example – Comparing the results of different treatments applied to the left
and right sides of a living organism.
3) Comparing the data obtained from the experiments conducted on identical
twins.
Example – Identifying the effect of diet type on the growth of children (One of
the identical twins is breastfed and the other one is fed with baby
food).
31
Paired t-Test

Steps of the test

Before starting the test, the differences of the pairs (first measurement-second
measurement, right side-left side, first child-second child of twins) are taken,
and then average 𝑥𝑓ҧ and variance (𝑆𝑓2 ) of the differences are calculated.

When taking the differences if H1:f0 or H1:fa the direction of subtraction


operation is not important. If the alternate hypothesis is established in one
direction generally first data are subtracted from the second data to get the
differences. The test is conducted in the following way:

32
Paired t-Test

Steps of the test

1) Hypotheses are established

33
Paired t-Test

Steps of the test

2) Critical table value is identified

𝑡𝑐 = 𝑡𝛼,(𝑛−1) for one tailed test

𝑡𝑐 = 𝑡𝛼/2,(𝑛−1) for two tailed test

34
Paired t-Test

Steps of the test

3) Test statistic is calculated

35
Paired t-Test

Steps of the test

4) Comparison is done

H0 is accepted

H0 is rejected

36
Paired t-Test

While conducting the paired t-test, in some cases it might be


assumed that the difference value equals to a certain (a) value and
a test is carried out to identify if the treatment increases the
difference or not. In this case during the establishment of
hypotheses (a) value is written instead of 0 for carrying out the
operations.

37
Example 6

A medicine, which is expected to increase the blood pressure, is


given to 10 patients, the blood pressure values before and after
taking the medicine are given in table. According to these data does
the medicine increase the blood pressure or not? (α = 0.01).
Patient No 1 2 3 4 5 6 7 8 9 10
Before 125 120 135 142 118 129 134 125 130 138
After 128 122 130 143 120 132 132 126 133 140
Difference 3 2 -5 1 2 3 -2 1 3 2

38
Example 6

Since the medicine is expected to increase the blood pressure the


values before taking the medicine is subtracted from the values
after taking the medicine (These values are given in the differences
row).

σ 𝑑𝑖𝑓𝑓𝑒𝑟𝑒𝑛𝑐𝑒𝑠 (3 + 2 + (−5) ⋯ + 2) 10
𝑥𝑓ҧ = = = =1
𝑛 10 10

(𝑥𝑖 −𝑥𝑓ҧ )2
𝑆𝑓2 = = 6.67
𝑛−1

39
Example 6

2) Critical table value is identified

3) Test statistic is calculated

Since th < tc 1.219 < 2.821, H0 is


accepted. This means that the
medicine did not increase the
blood pressure significantly.
40

You might also like