Upload
rione-drevale
View
52
Download
3
Embed Size (px)
DESCRIPTION
hypothesis_testing
Citation preview
FFT 2074 : WEEK 6❖ 17-26 oct-outstation ❖ Estimation & Hypothesis Testing ❖ Paired Test ❖ Proportion
Prepared by: Mdm. Yusrina Andu
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.
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.
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.
•
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.
➢ 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.
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.
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.
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.
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.
• 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.
Test statisticsThere are three common test statistics that are use 1. Z-test
!!
2. T-test !!
3. Chi-Square
Z-test•
Illustration of significance level, critical value and critical region
Two tail test with rejection region in both tails
•The rejection region is split equally between the two tails.
One tail test with rejection region on left•The rejection region will be in the left tail.
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?
Step 1: State the hypotheses•
Step 2: Set the criteria for a decision•
Step 3: Compute the test statistic•
Step 4: Make a decision•
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.
Paired test assumptions•
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
dµ
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
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.
Solution
•
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
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.
Solution•
•
Type I and Type II error•
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.
Summary
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