You are on page 1of 17

Statistics

(Practical)

Practical 3: Hypothesis Testing and T - Test

Soil and Water Sciences Department


College of Agriculture
University of Duhok
Hajar A. Ameen
Hajar. ameen@uod.ac
Outlines

 Hypothesis Testing
 Statistics used for Hypothesis Testing
 What is Alpha (α)
 What is P – Value

 One sample T - test


Types of Statistics
Statistics: The branch of mathematics that transforms data into useful
information for decision makers.
25
22.26

20 18.3

Descriptive statistics 15

Turque
Collecting, summarizing, and 10

describing data. 5

0
Machine 1 Machine 2

Inferential Statistics
Drawing conclusions and/or
making decisions concerning a
population based only sample data.
Statistical Tests

Chi – Squared = compares categorical variables


What is Hypothesis Testing?

Hypothesis testing is the use of statistics to determine the


probability that a given hypothesis or statements of
something is true.

Or it is a claim about a population parameter.

There are two types of statistical hypotheses:

1. Null hypothesis (H0)

2. Alternative hypothesis (H1 or Ha)


Null hypothesis (H0)

 Means “no relationship” or “no difference” exist


between variable under study.
 Or currently accepted value for a parameter

 The assumption that you make about population parameter


(not the sample).

µ = µ0 or µ1 - µ2 = 0

µ0 is the hypothesized mean


Alternative hypothesis (H1 or Ha)
 State that “a relationship” or “a difference” exist between
variables under study. Opposite to null hypothesis.

 The assumption that you make about population parameter


(not the sample).

µ ≠ µ0 or µ1 - µ2 ≠ 0

H1 = µ > µ0

H1 µ < µ0
Statistically Hypothesis Testing
 Z test compare one sample mean when standard
deviation is known and sample size n > 30.

T – testing = compare one sample means, when standard


deviation is unknown and sample size n < 30.

 T – test (paired and unpaired) = used to determine the


significance of the difference in means for two different groups
or samples

 ANOVA = compares > 2 samples means

 Correlation/regression

 Chi – Squared = compares categorical variables


What is P – value

P – value (probability value) is the probability for a


given statistical model, when the null hypothesis is true

 It indicates how likely it is that a result occurred by


chance alone

 P – value range from 0 - 1


What is Alpha (α)?
 Alpha (α) refer to the Level of significant

 When interpreting whether a P – value is significant


(beyond chance) or not, we need to know the level of
Alpha (α) being used for test.

 The most common levels are = 5% (0.05) and 1% (0.01)

 Alpha is decided before we are doing the analysis


Interpreting P – Value

If Alpha (α) = 0.05, the following rules are applied

 Low p value (p < 0.05) - reject null hypothesis and accept


alternative hypothesis
- statistically significant difference

 High p value (p > 0.05) - fail to reject the null hypothesis


- no statistically significant
difference

Example: if p value = 0.13 (with α = 0.05)

Since 0.13 > 0.05, this means that the test is not significant
Steps of Hypothesis Testing
1. State the null and alternative hypothesis.
2. Randomly select a sample to test your hypothesis.
3. Specify the level of significance (α) for your analysis. (commonly
used 0.05 and 0.01).
4. Apply the appropriate statistical test find P – value and to test H0
For this note the following :
- Null hypothesis, H0
- Sample size
- Population information known (i.e. σ known or standard
deviation).
5. Make a decision regarding the null hypothesis (Reject or accept H0).
6. State the conclusion of the hypothesis test in terms of the claim.
Example 1
A company of sugar production from sugar beet say that the average
sucrose percent in its production not less than 22%. Eight measurements
of sucrose percent done in different times and found that the observations
were: yi: 20, 24, 19, 23, 18, 22, 21, 19 , test the claim of the company using
5% level of probability ?

Step one: state the hypothesis


H0= μ ≥ 22
H1 = μ < 22 (Claim)

Step Two: the level of significance (α) α = 0.05

Step Three: Apply the appropriate statistical test


 Here we will use t test because we have one mean, the sample
size (n) < 30 and σ (standard deviation) is unknown
1.Select STAT > BASIC STATISTICS > One sample t
2. In 1- sample t box, select C1 (sucrose percent )
3- Activate perform hypothesis test, then in hypothesized mean write hypothesis
or claim mean (22).
4-Click options, in this box confidence level is 95%, and Alternative is less than.
5- Click OK, and then OK again.
Look in the Session window. You should see the following display:

If you look up in the table you will see that the P – value = 0.070
which is more than 0.05 (α).

Step four: Make a decision regarding the null hypothesis


Since P – value = 0.07 which is more the 0.05 we fail to
reject null hypothesis (H0 is accepted)

Step five: conclusion


The is not enough evidence to support the claim that sucrose
percent in the production of the company is less than 22%.
Homework
A bottled water manufacturer states on the product label that each bottle
contain 250mL of water. You work for a government agency that protects
consumers by testing product volume. A sample of 50 bottle is tested and
the data are given in table 1. Is there anything we can assume to be true?
Or is there sufficient evidence at the 5% level of significance to support the
claim that the volume of bottle is not equal to 250mL.

252 249 250 250 247 249 251 249 248 251 250 248 247 249 250 251 248 249 247 250 250 251 249 247 250

249 250 249 249 250 250 248 249 249 250 250 248 249 249 249 249 250 250 248 249 251 248 249 250 250

You might also like