lect w6 hypothesis_testing

37
FFT 2074 : WEEK 6 17-26 oct-outstation Estimation & Hypothesis Testing Paired Test Proportion Prepared by: Mdm. Yusrina Andu

Upload: rione-drevale

Post on 08-Jul-2015

53 views

Category:

Education


3 download

DESCRIPTION

hypothesis_testing

TRANSCRIPT

Page 1: Lect w6 hypothesis_testing

FFT 2074 : WEEK 6❖ 17-26 oct-outstation ❖ Estimation & Hypothesis Testing ❖ Paired Test ❖ Proportion

Prepared by: Mdm. Yusrina Andu

Page 2: Lect w6 hypothesis_testing

Introduction• Hypothesis testing is a method for testing a claim or hypothesis about a parameter in a population, using data measured in a sample.

• In hypothesis testing, a study is conduct to test whether the null hypothesis is likely to be true.

Page 3: Lect w6 hypothesis_testing

Four main steps to hypothesis testingStep 1: State the hypotheses Step 2: Set the criteria for a decision Step 3: Compute the test statistic Step 4: Make a decision.

Page 4: Lect w6 hypothesis_testing

Four main steps to hypothesis testingStep 1: State the hypotheses. !• Two hypotheses that must be stated which are null hypothesis and alternative hypothesis. !

• Null hypothesis is a statement about a population parameter, such as the population mean which is assumed to be true.

Page 5: Lect w6 hypothesis_testing

Page 6: Lect w6 hypothesis_testing

Step 2: Set the criteria for a decision !• This is the level of significance that is stated for a test. Usually is set at 5% or 0.05 level of significance test. !

• When the probability of obtaining a sample mean is less than 5% if the null hypothesis were true, then we conclude that the sample we selected is too unlikely and so we reject the null hypothesis.

Page 7: Lect w6 hypothesis_testing

➢ Significance level or level of significance refers to a criterion of judgement upon which a decision is made regarding the value stated in a null hypothesis. !

➢ The criterion is based on the probability of obtaining a statistic measured in a sample if the value stated in the null hypothesis were true.

Page 8: Lect w6 hypothesis_testing

Step 3: Compute the test statistic • The value of test statistics is used to make a decision regarding the null hypothesis. !

• A test statistics will tells us how far, or how many standard deviations a sample mean is from the population mean. !

• The larger the value of the test statistics, the further the distance, or the number of standard deviations, a sample mean is from the population mean stated in the null hypothesis.

Page 9: Lect w6 hypothesis_testing

Step 4: Make a decision. • The value of test statistics in Step 3 is used to make a decision about the null hypothesis which is based on the probability of obtaining a sample mean, given that the value stated in the null hypothesis is true.

• If the probability of obtaining a sample mean is less than 5% when the null hypothesis is true, then the decision is to reject the null hypothesis.

• If the probability of obtaining a sample mean is greater than 5% when the null hypothesis is true, then the decision is to retain the null hypothesis.

Page 10: Lect w6 hypothesis_testing

In summary, two decisions can be made by the researcher. ❖ Reject H0, sample mean is associated with low

probability of occurrence when the H0 is true. !

❖ Do not reject H0, sample mean is associated with a high probability of occurrence when the H0 is true.

Page 11: Lect w6 hypothesis_testing

P-Value• The probability of obtaining a sample mean given that the

value stated in the null hypothesis is true, is stated by the p value. !

• *p value is the probability which varies between 0 and 1 and can never be negative. In Step 2, the criterion or probability of obtaining a sample mean (at which either reject or not) is stated in the null hypothesis (set at 0.05).

• • In order to make a decision, the p value is compared with

the criterion set in Step 2.

Page 12: Lect w6 hypothesis_testing

• When the p-value is < 0.05, reject the null hypothesis. With such a low probability for the p-value, there is little likelihood that the observed difference between the sample mean and hypothesized mean is due to chance - it must be do to some program, process change, intervention or other effect.When the p-value is > 0.05, fail to reject the null hypothesis. There is a high probability for the p-value that the observed difference between the sample mean and the hypothesized mean is so small that it must be do to chance involved in sampling error.

Page 13: Lect w6 hypothesis_testing

Test statisticsThere are three common test statistics that are use 1. Z-test

!!

2. T-test !!

3. Chi-Square

Page 14: Lect w6 hypothesis_testing

Z-test•

Page 15: Lect w6 hypothesis_testing

Illustration of significance level, critical value and critical region

Page 16: Lect w6 hypothesis_testing

Two tail test with rejection region in both tails

•The rejection region is split equally between the two tails.

Page 17: Lect w6 hypothesis_testing

One tail test with rejection region on left•The rejection region will be in the left tail.

Page 18: Lect w6 hypothesis_testing

ExampleGiven a sample of 50 cows with an arithmetic mean for lactation milk yield of 4000 kg, does this herd belong to a population with a mean µ0 = 3600 kg and a standard deviation σ = 1000 kg?

Page 19: Lect w6 hypothesis_testing

Step 1: State the hypotheses•

Page 20: Lect w6 hypothesis_testing

Step 2: Set the criteria for a decision•

Page 21: Lect w6 hypothesis_testing

Step 3: Compute the test statistic•

Page 22: Lect w6 hypothesis_testing

Step 4: Make a decision•

Page 23: Lect w6 hypothesis_testing

Paired testPaired sample test is usually used for the following reasons: !✓ For repeated sample but to obtain different result ✓ To show the differences between two things which are

repeated. ✓ Only used for one group of samples but have repeated

things. !Paired test can use either z-test or t-test depending on the sample size.

Page 24: Lect w6 hypothesis_testing

Paired test assumptions•

Page 25: Lect w6 hypothesis_testing

t-TEST STATISTIC FOR PAIRED DIFFERENCES !!!where: = Mean paired difference µd = Hypothesized paired difference sd = Sample standard deviation of paired differences n = Number of paired differences

d

1−=−

= ndf

ns

dtd

Page 26: Lect w6 hypothesis_testing

PAIRED DIFFERENCE !!!where: d = Paired difference x1 and x2 = Values from sample 1 and 2

21 xxd −=

MEAN PAIRED DIFFERENCE !!where: di = ith paired difference n = Number of paired differences

∑=

=n

iidd

1

STANDARD DEVIATION FOR PAIRED DIFFERENCES !!!where: di = ith paired difference = Mean paired difference

1

)(1

2

−=∑=

n

dds

n

ii

d

d

Page 27: Lect w6 hypothesis_testing

ExampleThe effect of a treatment is tested on milk production of dairy cows. The cows were in the same parity and stage of lactation. The milk yields were measured before and after administration of the treatment.

Page 28: Lect w6 hypothesis_testing

Solution

Page 29: Lect w6 hypothesis_testing

Page 30: Lect w6 hypothesis_testing

Proportion

• The probability of a successful trial in a binomial experiment.

• For a sample of size n and a number of successes y, the proportion is equal to !

• However, if the sample is large enough, a normal approximation can be use, with the number of failure is !

• Test statistics for Z random variable is !

• Hypothesis testing for two sided test is

Page 31: Lect w6 hypothesis_testing

ExampleThere is a suspicion that due to ecological pollution in a region, the sex ratio in a population of field mice is not 1:1, but there are more males. An experiment was conducted to catch a sample of 200 mice and determine their sex. There were 90 females and 110 males captured.

Page 32: Lect w6 hypothesis_testing

Solution•

Page 33: Lect w6 hypothesis_testing

Page 34: Lect w6 hypothesis_testing

Type I and Type II error•

Page 35: Lect w6 hypothesis_testing

Type I Error: Rejecting a true null hypothesis. In hypothesis testing, the probability of making a type one error is labeled alpha, the level of significance.Type II Error: Failing to reject a false null hypothesis. The probability of making a type two error is labeled beta.

Page 36: Lect w6 hypothesis_testing

Summary

Page 37: Lect w6 hypothesis_testing

P-value Decision Conclusion

less than 5% (p < 0.05),

Reject H0 Significance

equals to 5% (p = 0.05),

Reject H0 Significance

more than 5% (p > 0.05),

Fail to Reject H0

Not Significance

Summary