Presentation is loading. Please wait.

Presentation is loading. Please wait.

chapter-7 hypothesis testing for quantitative variable

Similar presentations


Presentation on theme: "chapter-7 hypothesis testing for quantitative variable"— Presentation transcript:

1 chapter-7 hypothesis testing for quantitative variable
2018/12/7

2 contents introduction Hypothesis testing 2.1 One sample t test
2.2 two independent-samples t test 2.3 Paired-samples t test As a result of this class, you will be able to ... 2018/12/7

3 Methods1. Compute and compare two population mean directly
Hypothesis testing Aim: Is the average English score of students from 2 schools different or same? Methods1. Compute and compare two population mean directly 2018/12/7

4 Methods 2 Do a sampling study and then do hypothesis testing
Aim: Is the average English score of students from 2 schools different or same? Methods 2 Do a sampling study and then do hypothesis testing 2018/12/7

5 True difference between two population means. Chance (sampling error)
The reason that True difference between two population means. Chance (sampling error) So the hypothesis task is to differentiate that the difference between two samples is from the true difference between two population means or from chance. 2018/12/7

6 SectionⅠ Introduction
2018/12/7 9

7 “Is the effect of the new drug significant than the old drug?”,
The purpose of hypothesis testing is to aid the clinician, researcher, or administrator in reaching a conclusion concerning a population by examining a sample from the population. “Is the effect of the new drug significant than the old drug?”, “which one is better between the two operations? ” “Did the large amounts of advertising describe the benefits of new drugs? ” 2018/12/7

8 1 What does statistic test do?
[EXAMPLE1] General the average height of 7 years old children increases 4cm in one year. Some researcher let 100 of 7 years old children get a bread appended lysine in everyday. After one year the average height of 100 children increases 5cm, and the standard deviation is 2cm. Basing on the data can we think: lysine benefits growth of stature of 7 years old children? 2018/12/7

9 Suppose =0 Compute T.S Find P-value 2018/12/7

10 2 Steps of hypothesis testing
The statisticians have made a set of steps as fixed as legal procedure, and made some formulas to calculate test statistic (T.S). STEPS 2018/12/7

11 STEPS P>α P≤α Set up hypothesis and confirm α
compute test statistic Find P value P>α P≤α Make conclusion Reject H0, the difference is significant. Don’t reject H0, the difference is not significant 2018/12/7

12 Put forward null hypothesis and alternative hypothesis
 What is null hypothesis? 1. The test is designed to assess the strength of the evidence against Ho. 2. It is denoted by H0 H0:  0 2018/12/7

13 Put forward null hypothesis and alternative hypothesis
 What is alternative hypothesis? (1) It is contradictory to null hypothesis (2) It is denoted by H1 H1: < 0 ,   0 or   0 2018/12/7

14 Confirm significant level 
 What is significant level? a probability of rejecting a true null hypothesis denoted by α (alpha) Generally, 0.05. determined by the investigator in advance. 2018/12/7

15 Determine the appropriate T.S
The selection of test statistics is related with many factors, such as the type of variable, research aims and conditions proffered by the sample. 2018/12/7

16 Find P-value and draw conclusion
The mathematician have calculated probability corresponding to every T.S, and listed in some tables. This is the probability that the test statistic would weigh against Ho at least as strongly as it does for these data. 2018/12/7

17 Find P-value and draw conclusion
If P≤α, we reject Ho in favor of H1 at significant level α, We may think that the two populations are different; If P>α, we don`t reject Ho at significant level α. We may think that two populations are same. 2018/12/7

18 TypeⅠerror versus typeⅡ error in hypothesis testing
Because the predictions in H0 and H1 are written so that they are mutually exclusive and all inclusive, we have a situation where one is true and the other is automatically false. when H0 is true ,then H1 is false. If we don’t reject H0,we have done the right thing. If we reject H0 ,we have made a mistake. Type Ⅰ error: Reject H0 when it is true. The probability of type Ⅰ error is   2018/12/7

19 TypeⅠerror versus typeⅡ error in hypothesis testing
when H0 is false ,then H1 is true. If we don’t reject H0 , we have made a mistake. If we reject H0 , we have done the right thing. TypeⅡ error : Don’t reject when it is false. The probability of type Ⅱ error is .  is more difficult to assess because it depends on several factors. 1-  is called the power of the test. 2018/12/7

20 State of nature H0 is real H0 is false
Decision State of nature H0 is real H0 is false Don’t reject H0 Correct decision 1 - α type Ⅱ error (β) Reject H0 type Ⅰ error (α) Test power (1-β) 2018/12/7

21 Tradeoff between  and 
You can not reduce two types error at the same time when n is fixed For fixed n, the lower , the higher . And the higher , the lower  2018/12/7

22 Two-sided test and one-sided test
1 Two-sided test:Interest in whether m  m0 2 One-sided test:Interest in whether m  m0 , or m  m0 2018/12/7

23 Comparison of sample mean
and population mean μo hypothesis basing on study aim Two-sided One-sided H0 m = m0 H1 m ≠m0 m ≤ m0 m > m0 or m ≥m0 m < m0 2018/12/7 9

24 H0 H1 Comparison of two sample means m1 = m2 m1 ≠ m2 m 1 ≥ m2 m1 ≤ m2
hypothesis basing on study aim Two-sided One-sided H0 m1 = m2 H1 m1 ≠ m2 m 1 ≥ m2 m1 < m2 m1 ≤ m2 m1 > m2 or 2018/12/7 9

25 Two-sided test Confidence level Reject region Reject region H0 T.S
Rejection region does NOT include critical value. 1 -  a/2 a/2 Not reject region H0 T.S Critical value Critical value 2018/12/7

26 one-sided test Confidence level Reject region a H0 Critical value T.S
Rejection region does NOT include critical value. 1 -  a Not reject region H0 Critical value T.S 2018/12/7

27 one-sided test Confidence level Reject region a H0 Critical value T.S
1 -  Rejection region does NOT include critical value. a Not reject region H0 Critical value T.S 2018/12/7

28 Section Ⅱ t-test 2.1 One sample t test
2.2 Two independent-samples t test 2.3 Paired-samples t test 2018/12/7 9

29 How to do one-sample hypothesis test?
yes One sample t test no Does the sample come from normal population? One sample rank sum test

30 2.1 One sample t test Test statistic
Model assumptions of one-sample t-test (1) n≥50 (2) n<50 and the sample comes from normal population. Test statistic 2018/12/7

31 EXAMPLE1 Generally the average height of 7 years old children in city A increases 4cm in one year. One researcher let 100 children of 7 years old randomly drawn from the city A get a bread appended lysine in everyday. After 1 year the average height of 100 children increases 5cm, and the standard deviation is 2cm. Basing on the data can we think: lysine benefits growth of stature of 7 years old children? 2018/12/7

32 Solution: Compute T.S df=100-1=99 Ho: μ≤μo H1: μ>μo =0.05
2018/12/7

33 Find P-value and draw conclusion
∵ t=5>1.660 ∴ P < 0.05 Because P is smaller than α, we reject Ho at the significant level 0.05 in favor of H1 . We can think that lysine benefits growth of stature of 7 years old children. 2018/12/7

34 Table 2 2018/12/7

35 one-sided test Confidence level Reject region a H0 1.660 1 - 
Rejection region does NOT include critical value. a Not reject region H0 1.660 5 2018/12/7

36 【exercise 1】25 adult female was chosen randomly from Zhengzhou city in 2010 and the systolic blood pressure was measured by standard methods. To test whether the average of SBP in Zhengzhou city is same with the average level( 126.5mmHg) in China? 2018/12/7

37 How to do two-samples hypothesis test?
Is n larger than 50 in both groups? yes no Do two samples come from normal population? Are two population variances equal? Two-independent samples t test Correction t test Wilcoxon rank sum test 2018/12/7

38 2.2 two independent-samples t test
assumptions The data of two samples must come from normal distribution. Two population variances are equal. Test statistic degree of freedom 2018/12/7

39 2.2 two independent-samples t test
When the assumption of normal distribution is valid while the equality of variance is violated , we should choose correction t test ( test) When the assumption of normal distribution is violated , we should choose rank sum test. 2018/12/7

40 test 2018/12/7

41 Example 2 Company officials were concerned about the length of time a particular drug product retained its potency. A random sample, sample 1, of n1=10 bottles of the product was drawn from the production line and analyzed for potency. A second sample, sample 2, of n2=10 bottles was obtained and stored in a regulated environment for a period of one year. Whether the two population mean are different at 0.05 level? Suppose the two samples come from normal population. 2018/12/7

42 Table 5.1 potency for two samples
sample sample 2 Calculated : 2018/12/7

43 Solution : Ho: μ1=μ2 H1: μ1≠μ2 α= 0.05 Compute t
t 0.05,18=2.101, so P<. We reject Ho in favor of H1 at level 0.05, then we can think their potencies are different. 2018/12/7

44 Table 2 2018/12/7

45 Two-sided test Confidence level Reject region Reject region H0 1 - 
Rejection region does NOT include critical value. 1 -  a/2 a/2 Not reject region H0 4.24 -2.101 2.101 2018/12/7

46 EXAMPLE 2 2018/12/7

47 H0: Normal H1: Not normal SAMPLE1 normal SAMPLE2 normal 2018/12/7

48 Result of correction t test
Result of t test Tests of equality of variance Result of correction t test 2018/12/7

49 If 12≠22 12= 22 To test equality of variances?
Ho: 12= 22 , H1: 12≠22 =0.05 Compute F Conclusion : find F critical value in table 4. If 12≠22 12= 22 2018/12/7

50 , so we can think: 12= 22 . we have known: S12 =0.105, n1 =10,
Ho: 12= 22 , H1: 12≠22 ,=0.05 Compute F Conclusion : find F critical-value in table 4. , so we can think: 12= 22 . 2018/12/7

51 EXERCISE 2 Table 1 increase of concentration of Hb in two groups
2018/12/7

52 Analyze→ Descriptive Statistics→ Explore Dependent list→ y
Factor list→group Plots→√Normality plots with tests Continue OK 2018/12/7

53 Analyze→ Compare means→ Independent- sample T Test
Test Variable(s) → y Grouping Variable→group Define Groups→ Group 1: 1; Group 2: 2 Continue OK 2018/12/7

54 【SPSS】 2018/12/7

55 【SPSS】 2018/12/7

56 How to report the result?
The data of two samples were adequately normally distributed(Shapiro-Wilk test:P1=0.466;P2=0.482) and two population variances were equal at the significant level 0.10(F=1.345;P=0.261), so two independent samples t test was used(t=4.137; df=18;P=0.001). The results indicated a statistically significant difference between effects of two drugs at two-sided significant level 0.05 and the average increase of concentration of Hb was higher in patients taking the new drug, which could also be observed from the 95% confidence interval of the difference of two population means (3.829, ). 2018/12/7

57 How to report the result?
2018/12/7

58 Does the difference of paired-samples come from normal population?
How to do paired-samples hypothesis test? n is the number of pairs n>50? yes Paired-samples t test no Does the difference of paired-samples come from normal population? rank sum test

59 2.3 Paired-samples t test Test statistic Model assumptions
The differences among each paired-samples must come from normal distribution population. Test statistic numbers of pairs 2018/12/7

60 d: difference between each pair; : sample mean of difference;
New concepts: d: difference between each pair; : sample mean of difference; Sd: sample standard deviation of difference; n: number of pairs of sample. 2018/12/7

61 2.3 Paired-samples t test When the assumption of normal distribution of difference is violated, we should make data transformation or choose rank sum test. 2018/12/7

62 There are two forms in paired t-test:
1 The study objects are matched by certain conditions (the same weights 、the same age or the same sex). Then the two study objects of each pair are assigned randomly to different groups. 2 One study objects receive two different disposals.The aim is to infer whether there is difference between the effect of two disposals. 2018/12/7

63 randomization pair 20 rabbits Treat 1 10 rabbits ! “ # $ % & ‘ ( ) *
2018/12/7

64 While analyzing paired data, the differences between each paired are more important than the raw data. The aim is to compare whether the efficiency of two factors is different. 2018/12/7

65 Example 3 Insurance adjusters are concerned about the high estimates they are receiving from garage 1 for auto repairs compared to garage 2. To verify their suspicions, that is, the mean repair estimate for garage 1 is greater than that for garage 2, each of 15 cars recently involved an accident was taken to both garages for separate estimates of repair costs. Is true their suspicions? 2018/12/7

66 Table 3 Repair estimates(in hundreds of dollars)
car Garage 1 Garage 2 Difference(d) d2 1 7.6 7.3 0.3 0.09 2 10.2 9.1 1.1 1.21 3 9.5 8.4 4 1.3 1.5 -0.2 0.04 5 3.0 2.7 6 6.3 5.8 0.5 0.25 7 5.3 4.9 0.4 0.16 8 6.2 0.9 0.81 9 2.2 2.0 0.2 10 4.8 4.2 0.6 0.36 11 11.3 11.0 12 12.1 13 6.9 6.1 0.8 0.64 14 6.7 15 7.5 Totals 2018/12/7

67 Solution: This is comparison of paired data, so we should use paired-samples t test.
2018/12/7

68 Population mean of difference
1 Set up the hypothesis and confirm α Ho: µd= 0 H1: µd > 0 α= 0.05 2 Compute t Population mean of difference 2018/12/7

69 3 Confirm p-value and draw conclusion
df =14, t = 6.0, t(14, 0.05)=1.761 so P < 0.05 We reject Ho in favor of H1 at level We believe that the suspicions of the insurance adjusters are true, that is, the mean repair estimate for garage 1 is greater than garage 2 2018/12/7

70 Table 2 2018/12/7

71 EXAMPLE 3 2018/12/7

72 Compute difference of each pairs
Normality tests of difference 2018/12/7

73 Normal 2018/12/7

74 Analyze→ Compare means→ one sample t Test Test Variables →difference
Method1 Analyze→ Compare means→ one sample t Test Test Variables →difference Test value → 0 OK 2018/12/7

75 2018/12/7

76 Analyze→ Compare means→ paired-samples t Test
Method 2 Analyze→ Compare means→ paired-samples t Test Paired Variables→garage1-garage2 OK 2018/12/7

77 2018/12/7

78 Exercise One doctor want to explore whether the height of adult males is higher than that of the adult females. He chose randomly 64 males and 49 females and measured their heights one by one. The outcome are as follows Question: Is the height of adult males higher than that of the adult females. 2018/12/7

79 2018/12/7

80 To test homogeneity of two population variances
Ho: 12= 22 , H1: 12≠22 =0.05 Compute F Conclusion : not significant, we can think the two population variance are same 2018/12/7

81 Solution : Ho: μ1≤μ2 H1: μ1>μ2 α= 0.05 Compute t
P<. We reject Ho in favor of H1 at level 0.05, then we can think height of adult males higher than that of the adult females. 2018/12/7

82 Thanks for your attention!
2018/12/7


Download ppt "chapter-7 hypothesis testing for quantitative variable"

Similar presentations


Ads by Google