Presentation is loading. Please wait.

Presentation is loading. Please wait.

Inferences concerning two populations and paired comparisons

Similar presentations


Presentation on theme: "Inferences concerning two populations and paired comparisons"— Presentation transcript:

1 Inferences concerning two populations and paired comparisons
Chapter 9

2 Inferences concerning two populations
가장 일반적으로 사용되는 통계처리 기법 둘 또는 다수의 populations 사이의 유의한 차이 유무를 결정하는 tests Ex. 1. 흡연자와 비흡연자 사이에 심장박동수가 차이가 있는가?: 두 평균치 비교 Ex. 2. copper sulfate 농도가 bluegill fish의 gill 내의 mucus cell의 density에 어떻게 영향을 미치는가?: 3 이상의 평균치 비교

3 Inferences concerning two populations
In this chapter Two population means이 서로 차이가 있는가? In the first part: two independent sample means 사이의 차이 Two samples이 다른 population으로부터 옴 In the second part: related samples을 다룸 Matched-paired samples: 동일한 개체에서 두 번 측정되었거나 신중하게 짝지어진 개체들에서 측정 More than two populations 간의 차이는 chapter 11에서 다룸

4 The t-test for two independent samples
Two independent populations을 비교하는 가장 powerful 한 test (low type II error!!) a parametric test Parametric test의 assumptions을 만족시키지 못할 경우 가장 유용한 non-parametric test Mann-Whitney test Variables이 normal distribution을 할 경우 variance (분산)이 알려지지 않은 population으로부터의 sampling한 sample means은 t-distribution을 한다 (chapter 7) 이 개념을 이용하여 single population mean의 confidence interval을 추정함 (chapter 8) 이러한 이유로 two population means의 차이를 t-distribution을 이용하여 test

5 The t-test for two independent samples
Two population means을 비교할 때 null hypothesis Two populations의 평균값 사이에 차이가 없다 H0: μa = μb t-value ( a – b ): two sample means의 차이 (μa – μb): two population means의 차이, 귀무가설이 (μa = μb)일 경우 zero sp: two means 사이 차이의 standard error

6 The t-test for two independent samples
t-value Degree of freedom: na–1 or nb-1 중 작은 값 t-test의 assumptions 1. Samples are collected randomly from two population 2. Variables가 approximately normally distributed, and continuous, 만약 variables가 discrete 하면 넓은 범위의 값을 가져야 함 3. measurements가 interval or ratio scale

7 The t-test for two independent samples
Assumption 2 or 3을 만족하지 못할 경우 Mann-Whitney test를 사용 Assumption 1을 만족하지 못할 경우는? Data를 사용할 수 없음 통계처리 불가능 t-test는 powerful and robust Powerful: type II error 의 확률이 높지 않다 Robust: data가 assumptions을 다소 만족하지 못하더라도 유효하게 사용할 수 있음 Sample size가 클 경우 더 사실임

8 The t-test for two independent samples
Ex. 9.1 식물 두 종의 root hair cell의 length to width의 ratio Variables은 normal distribution 두 population의 means이 유의한 차이가 있는가? Null hypothesis? One-tailed or two-tailed? Species A Species B n 12 18 mean 1.28 4.43 s2 0.112 7.072

9 The t-test for two independent samples
Null hypothesis H0: μa = μb Alternative hypothesis Ha: μa ≠ μb Two-tailed or one-tailed test? Two-tailed test t-value: t = (1.28 – 4.43) / √(0.112/ /18) = Two-tailed test 이므로 t-value의 절대값이 중요 Critical value of t (df = 11, α = 0.05) = 2.201 p value: < p < 0.001 따라서 귀무가설 (two population means이 같다)을 reject Two population means은 같지 않다

10 Confidence interval for the difference between two population means
95% confidence interval for μa – μb k: degree of freedom 95% CI for μa – μb = (4.43 – 1.28) ± × √(7.702/ /12) = 3.15 ± 1.40 = 1.75 – 4.55 (차이가 적어도 1.75 이상이며, 4.55 이하이다)

11 Exercises Ex. 1. 한 호수에서 largemouth bass와 smallmouth bass 의 길이 (in mm)
두 종의 길이에 차이가 있는가? Null hypothesis, Alternative hypothesis?? Appropriate test? Conclusion? Largemouth Smallmouth n 125 97 mean 272.8 164.8 s 96.4 40.0

12 Exercises Null hypothesis H0: μL = μS
Alternative hypothesis HA: μL ≠ μS t = (272.8 – 164.8) / √ / /97 = Degree of freedom: 97 – 1 = 96 Critical t value (two-tailed): (1.984 or 2.000?) 따라서 귀무가설을 reject 이 호수에서 largemouth bass와 smallmouth bass의 길이가 같지않다

13 Exercises Ex. 2: 두 장소에서 도마뱀의 무게차이
Location A 에 서식하는 도마뱀이 location B에 서식하는 도마뱀에 비해 더 무거운지를 알고자 함 Location A Location B Null hypothesis, Alternative hypothesis?? Appropriate test? Conclusion?

14 Exercises Null hypothesis H0: μA ≤ μB
Alternative hypothesis HA: μA > μB Mean of population A: Mean of population B: 551.0 SS = Σ x2 – (Σx)2/n SS / n-1 = variance (분산) = s2 t = ( – ) / √ / /7 = 0.945 Degree of freedom: 7 – 1 = 6 Critical t value (one-tailed): 1.943 따라서 귀무가설을 reject 할 수 없다 Location A에 서식하는 도마뱀이 더 무겁지 않다

15 Exercises Ex. 3: 소나무 묘목의 생장률 차이 Molybdenum을 넣어준 배지에서 더 잘 자라는가?
Without molybdenum (mean: 3.79; variance: ) With molybdenum (mean: 6.23; variance: ) Null hypothesis, Alternative hypothesis?? Appropriate test? Conclusion?

16 Exercises Null hypothesis H0: μwith ≤ μwithout
Alternative hypothesis HA: μwith > μwithout Mean of without: 3.79 Mean of with: 6.23 SS = Σ x2 – (Σx)2/n SS / n-1 = variance (분산) = s2 t = (6.23 – 3.79) / √0.2248/ /7 = 6.15 Degree of freedom: 7 – 1 = 6 Critical t value (one-tailed): 1.943 따라서 귀무가설을 reject Molybdenum이 들어간 배지에서 더 잘 자란다

17 A nonparametric test for two independent samples: the Mann-Whitney test
자료들이 t-test 의 가정들을 만족시키지 못할 경우가 있다 Ex. 1. Measurement가 ordinal scale인 경우 Ex. 2. variables이 normal distribution을 하지 않을 경우 이럴 경우 Mann-Whitney test를 사용 Non-parametric counterpart of the t-test for two independent samples t-test의 가정을 만족할 경우 t-test 가 more powerful (low type II error) t-test의 가정을 만족하지 못할 경우 Mann-Whitney test가 more powerful

18 A nonparametric test for two independent samples: the Mann-Whitney test
Mann-Whitney test에서는 median (중앙값; θ)을 이용 Skewed distribution에서는 median이 더 유용하므로 Null hypothesis of the Mann-Whitney test Samples들이 동일한 median을 가진 populations으로부터 추출되었다 H0: θa = θb Assumptions of the test Two population distributions이 same shape (normal distribution일 필요는 없음) Random samples Sample size가 같을 필요는 없다

19 A nonparametric test for two independent samples: the Mann-Whitney test
두 samples의 data를 같이 순서를 매긴다 The lowest value: rank of 1 The next lowest: rank of 2 같은 값은 average rank를 가짐

20 The Mann-Whitney test Ex. 9.2 표범의 territory (영역) 면적 (hectares)
Territory size를 두 지역에서 random sampling 두 지역의 territory size가 차이가 있는가? Location A Location B 동물의 territory size는 일반적으로 normal distribution을 하지 않는다 (사람의 salary와 유사) Mann-Whitney test 사용

21 The Mann-Whitney test Ex. 9.2 Ua와 Ub를 다음 식으로 계산함

22 The Mann-Whitney test Ua = (9*10) + 9(9+1)/2 – 64.5 = 70.5
Ub = (9*10) – Ua = 90 – 70.5 = 19.5 Table A. 4: critical values of U Sample size가 20 이하일 경우 (20 이상의 경우는?) For two-tailed test: use the top half For one-tailed test: use the bottom half Ua, Ub 중 하나라도 critical value 이상일 경우 귀무가설 (H0: θa = θb)을 reject From Table A.4, two-tailed test, α = 0.05, sample size 9 and 10, Critical value of U? 70 (null hypothesis reject or accept??) 따라서 귀무가설을 reject 두 지역의 territory size는 같지 않다

23 The Mann-Whitney test Ex. 9.2 Statistical package의 결과 (MINITAB)

24 The Mann-Whitney test For one-tailed test
Use the bottom half of the table A.4 If H0: θa ≥ θb (Ha: θa < θb) Ua를 test statistic으로 사용 If H0: θa ≤ θb (Ha: θa > θb) Ub를 test statistic으로 사용

25 위의 문제에서 location B의 territory가 더 넓은지를 알고자 했을 경우는?
The Mann-Whitney test 위의 문제에서 location B의 territory가 더 넓은지를 알고자 했을 경우는? Null hypothesis? H0: θa ≥ θb (Ha: θa < θb) Test statistic? Ua = 70.5 Critical value of U? One-tailed test: U = 66 Test statistic이 critical value 보다 크다. 따라서 귀무가설을 reject Location B의 표범 territory가 더 넓다

26 The Mann-Whitney test Sample size가 20보다 클 경우
Sample size 가 20보다 클 경우는 U의 확률분포가 approximately normal distribution 이 경우 z value를 이용할 수 있다 (table A.1) z 값은 아래 공식으로 계산 U: either Ua or Ub (sign 만 달라짐) Two-tailed test (α=0.05) 에서 z의 절대값이 (p = 0.475) 이상일 경우 null hypothesis를 reject 절대값이 (p = 0.495) 이상일 경우 null hypothesis를 (α=0.01) 수준에서 reject

27 Tests for two related samples
Paired samples을 사용하는 경우 1. Before and after study의 경우 2. 매우 유사한 개체들을 짝 지워 다른 실험적 처리를 한 경우 Control group과 experimental group은 treatment 이외의 다른 조건은 동일하다고 볼 수 있다

28 Paired test의 유용성 Ex. 어떤 약이 사람의 심장박동에 미치는 영향을 조사
사람들을 2 groups으로 나눈 후 한 group (control group)에는 placebo (위약) 을 다른 group (treatment group)에는 experimental drug을 투약 Two independent samples: 실험대상들은 나이, 성별, 흡연유무, caffeine 섭취 정도 등이 다를 수 있다 실험 전부터 심장박도에 차이: 이러한 treatment과 관련 없는 개체들 사이의 변이를 error variance (오차분산) 이라 한다 두 평균값 사이의 차이가 크지 않고 error variance가 클 경우 null hypothesis를 reject 하는 것을 실패할 위험성이 높아진다 Type II error 가 발생한다 . 이러한 위험성을 sample size를 크게 하여 감소시킬 수 있다 (다수의 실험 수행이 필요) Paired design으로 error variance를 감소시킬 수 있다 짝지어진 두 개체는 treatment 이외에는 거의 같다고 할 수 있으므로

29 Assumptions of the test
The paired t-test Assumptions of the test 1. variable (변수)는 interval or ratio scale 2. variable의 distribution은 approximately normal 3. 각 개체들은 두 번 측정 되었거나 (before and after the specified treatment), 대응된 두 개체 (matched pairs of individuals)에서 측정되어야 함 4. data는 random sample from the population

30 Ex. 9.3: an example of before and after study
The paired t-test Ex. 9.3: an example of before and after study 애벌레 (10 마리) 체중 증가를 측정 age에 따른 체중 증가 각 개체를 one week age 일 때와 two week age일 때 체중을 측정 시간 경과에 따른 체중증가 Two independent t-test or paired t-test? Paired t-test One-tailed or two-tailed test? One-tailed hypothesis test

31 The paired t-test Null hypothesis 1주와 2주 사이의 체중의 차이 (μD)는 0 과 같거나 작다
H0: μD ≤ 0 (μ2 ≤ μ1); Ha: μD > 0 (μ2 > μ1)

32 The paired t-test 체중의 차이 (between 1 week and two weeks): D
차이의 mean: D = 1.26 t-value는 아래 공식으로 계산 자유도: n – 1 = 10 – 1 = 9 sD: standard error of the mean difference = sD / √n = / √10 = 0.169 t = 1.26 / = 7.46 Critical t value (alpha=0.05, df=9, one-tailed) (p < ) 따라서 null hypothesis를 reject: 체중이 유의하게 증가됨

33 Exercises Ex. 3: 운동 전과 후의 체온 변화 8명의 운동 전후 체온을 측정, 변화가 있는가?
Null hypothesis, Alternative hypothesis?? Appropriate test? Conclusion? Individual # Resting Post-exercise 1 99.0 99.4 2 97.8 98.1 3 98.6 4 98.7 5 6 98.2 7 98.8 8 99.2

34 Exercises Ex. 3: 운동 전과 후의 체온 변화 8명의 운동 전후 체온을 측정, 운동 후에 체온이 달라졌는가?
Null hypothesis Tafter = Tbefore Alternative hypothesis?? Tafter ≠ Tbefore Appropriate test: two tailed paired t-test

35 The paired t-test 체온 차이의 mean: D = 0.175 t-value는 아래 공식으로 계산
Individual # Resting Post-exercise difference 1 99.0 99.4 0.4 2 97.8 98.1 0.3 3 98.6 0.0 4 98.7 5 6 98.2 7 98.8 0.1 8 99.2 0.6 체온 차이의 mean: D = 0.175 t-value는 아래 공식으로 계산 자유도: n – 1 = 8 – 1 = 7 sD: standard error of the mean difference = sD / √n = / √8 = t = / = Critical t value (alpha=0.05, df=7, two-tailed) 2.365 따라서 null hypothesis를 reject 할 수 없다 운동 전후의 체온이 차이가 없다

36 Exercises Ex. 3: 운동 전과 후의 체온 변화 8명의 운동 전후 체온을 측정, 운동 후에 체온이 증가하는가?
Null hypothesis, Alternative hypothesis?? Appropriate test? Conclusion? Individual # Resting Post-exercise 1 99.0 99.4 2 97.8 98.1 3 98.6 4 98.7 5 6 98.2 7 98.8 8 99.2

37 Exercises Ex. 3: 운동 전과 후의 체온 변화 8명의 운동 전후 체온을 측정, 운동 후에 체온이 증가하는가?
Null hypothesis Tafter ≤ Tbefore Alternative hypothesis?? Tafter > Tbefore Appropriate test: one-tailed paired t-test

38 The paired t-test 체온 차이의 mean: D = 0.175 t-value는 아래 공식으로 계산
sD: standard error of the mean difference = sD / √n = / √8 = t = / = Critical t value (alpha=0.05, df=7, one-tailed): 1.895 2.1394: < p < 0.05 따라서 null hypothesis (Tafter ≤ Tbefore)를 reject 운동 후에 체온이 올라간다

39 Nonparametric tests for two related samples
Matched pairs 나 repeated-measures experiments에서 parametric tests의 가정을 만족하지 못할 경우 두 종류의 nonparametric tests가 존재 The sign test The Wilcoxon signed-ranks test 차이의 방향 (< or >)은 알 수 있으나 차이의 크기는 알 수 없을 경우 사용 Null hypothesis: p(A > B) = p(A < B) A가 B보다 클 확률과 작을 확률은 같다 A, B: matched pair의 measurements 각 pair (대응 쌍)은 plus or minus sign을 가지게 된다 같은 값을 가진 pair는 버린다. 따라서 n이 감소될 수 있다

40 Nonparametric tests for two related samples
The sign test Binomial distribution과 같아 진다 H0: frequency of pluses = frequency of minuses p = 0.5, q = 0.5, k = number of pairs (n) Ex. 9.4 축구선수들이 스포츠 음료를 마신 후 느낌을 조사 Better than, worse than, or the same Better: 9명, worse: 1명, same: 2명 스포츠 음료가 선수들의 기분에 영향을 미치는가? Measurement scale?? Nominal scale Parametric test를 사용할 수 없다

41 Nonparametric tests for two related samples
Before and after experiment의 예 각 대상자들이 음료를 마신 전과 후를 조사함 각 대상자의 변화의 방향을 알 수 있다, 정도는 알 수 없다: Sign test 9 pluses and 1 minuses 10 trials 중 9 plus sign과 1 minus sign이 나올 확률을 다음 식으로 계산 할 수 있다 (이항분포 확률) p(1) = (10!/1! × 9!) × 0.51 × 0.59 =

42 Nonparametric tests for two related samples
10 trials 중 9 plus sign과 1 minus sign보다 더 극단적인 경우 10 plus sign과 0 minus sign 10 plus sign과 0 minus sign 이 나올 확률 p(0) = (10!/0! × 10!) × 0.50 × = p(1) + p(0) = = 이 확률은 단측확률 (one-tailed probability)이다 이 실험은 two-tailed test이다 따라서 확률은 one-tailed probability의 2배이다 따라서 p = ×2 = 확률이 0.05 이하이므로 귀무가설을 reject 귀무가설: 기분이 좋아지는 사람과 나빠지는 사람의 수가 같다 결론: 이 스포츠 음료가 축구선수들의 기분에 영향을 미침

43 Nonparametric tests for two related samples
만약 질문이 “이 스포츠 음료가 축구선수들의 기분을 향상시키는가?” 일 경우 One-tailed or two-tailed test? 이 경우는 one-tailed test Null hypothesis는? H0: 기분이 나빠지거나 변화가 없다 HA: 기분이 좋아진다 귀무가설을 reject or accept? 이 경우는 의 확률로 귀무가설이 reject 된다 (rather than ) p(1) + p(0) = =

44 The Wilcoxon signed-ranks test
Matched pairs 사이의 차이의 방향과 차이의 크기 순서를 정할 수 있을 경우에 사용 따라서 variable이 normal distribution을 하지 않고 ordinal, interval or ratio scale로 측정되었을 때 사용 가능 1) Paired measurements의 차이를 계산한 후 2) 차이의 순서를 그 절대값으로 정한다 3) 그러나 sign은 rank에 계속 남는다 4) Sign test처럼 차이가 없는 pair는 버린다 Null hypothesis H0: Positive ranks의 합과 negative ranks의 합은 같다

45 The Wilcoxon signed-ranks test
Ex. 9.5 암표범은 새끼가 있을 경우 더 공격적인가? 공격성의 정도를 1 – 10 (10: most aggressive) 7 마리의 암표범이 새끼가 있을 경우와 없을 경우에 공격성을 조사 Why non-parametric test? Ordinal scale

46 The Wilcoxon signed-ranks test
Ex. 9.5 3번과 7번의 차이가 같다 (sign은 다르지만) Test statistic (통계치): T T: 다른 sign을 가진 ranks 의 합 중 작은 값 Plus sign의 합: 26.5; minus sign 의 합: 1.5 따라서 T는 1.5 Critical value of T (in Table A.5): n=7일 경우: 2 계산된 T 값 (1.5)이 critical T value 이하일 경우 (Critical T value > calculated T value), null hypothesis를 reject 따라서 귀무가설을 reject 결론: 암표범은 새끼가 있을 경우 더 공격적이다

47 The Wilcoxon signed-ranks test
Table A.5에서는 sample size가 25 이하인 경우 만 기록 Sample size가 26 이상일 경우는 T가 approximately normal distribution을 한다 따라서 normal distribution을 이용할 수 있다 z value를 이용, z value는 아래 공식으로 계산한다 z의 절대값이 1.96 이상일 경우 null hypothesis를 reject (α = 0.05)

48 Review: Which statistical test is appropriate?
How many populations? Are the samples related or independent? Which scale of measurement is used? Are the data normally distributed? If not are sample size large (n > 30)?

49 Review: Which statistical test is appropriate?

50 Exercises Ex. 2: 두 장소에서 도마뱀의 무게차이
Location A 에 서식하는 도마뱀이 location B에 서식하는 도마뱀에 비해 더 무거운지를 알고자 함 Location A Location B 위의 variable이 normal distribution을 하지 않는다고 가정할 때 적절한 test는? Mann-Whitney test

51 Exercises Ex. 2: 두 장소에서 도마뱀의 무게차이 Location A
510(8) 773(16) 840(20) 505(7) 765(15) 780(17) 235(1) 790(18) 440(4) 435(3) 815(19) 460(6) 690(14) Location B 650(12) 600(10.5) 600(10.5) 575(9) 452(5) 320 (2), 660(13) Rank의 합 Location A: 148 Location B: 62

52 Exercises Ex. 2: 두 장소에서 도마뱀의 무게차이
Location A 에 서식하는 도마뱀이 location B에 서식하는 도마뱀에 비해 더 무거운지를 알고자 함 148; 62 Ua = 13*7 + 13*14/2 – 148 = – 148 = 34 Ub = 91 – 34 = 57 One-tailed, Critical U (n = 13, 7): 67 (Table A4) If H0: θa ≤ θb (Ha: θa > θb) Ub를 test statistic으로 사용 Ub 가 critical value 이상일 경우 귀무가설을 reject 귀무가설 reject할 수 없음 귀무가설 accept: Location A에서 더 무겁지 않다

53 Exercises Ex. 3: 운동 전과 후의 체온 변화 8명의 운동 전후 체온을 측정
위의 variable이 normal distribution을 하지 않는다고 가정할 때 적절한 test는? Wilcoxon signed-ranks test Individual # Resting Post-exercise 1 99.0 99.4 2 97.8 98.1 3 98.6 4 98.7 5 6 98.2 7 98.8 8 99.2

54 Exercises Ex. 3: 운동 전과 후의 체온 변화 Sum: (+) 10, (-) 0
T: 다른 sign을 가진 ranks 의 합 중 작은 값: T = 0 Table A. 5: Critical T value (n=4): 0 계산된 T 값이 critical T value 이하일 경우 귀무가설 reject 따라서 차이가 없다는 귀무가설 reject: 체온이 증가 Individual # Resting Post-exercise 1 99.0 99.4 0.4 3 2 97.8 98.1 0.3 98.6 4 98.7 5 6 98.2 7 98.8 0.1 8 99.2 0.6


Download ppt "Inferences concerning two populations and paired comparisons"

Similar presentations


Ads by Google