모수검정을위한가정 1 종속변수가양적변수이어야함 2 모집단분포가정규분포 3 등분산가정 (equal variance assumption) 이충족되어야함 error term or residual = 이들가정은약자로 NID (0, σ 2 ) 로표현 : Normally, Ind

Save this PDF as:
 WORD  PNG  TXT  JPG

Size: px
Start display at page:

Download "모수검정을위한가정 1 종속변수가양적변수이어야함 2 모집단분포가정규분포 3 등분산가정 (equal variance assumption) 이충족되어야함 error term or residual = 이들가정은약자로 NID (0, σ 2 ) 로표현 : Normally, Ind"

Transcription

1 강의 5 추리통계를위한가설검정 : 모수, 비모수통계선택 6. 모수 - 비모수통계선택과정 표본평균차이검정방법 - 1 -

2 모수검정을위한가정 1 종속변수가양적변수이어야함 2 모집단분포가정규분포 3 등분산가정 (equal variance assumption) 이충족되어야함 error term or residual = 이들가정은약자로 NID (0, σ 2 ) 로표현 : Normally, Independently, Distributed with mean of zero and common variance(σ 2 ) * 등분산가정의검정 : 1) F max test - max S 2 /min S 2 (Critical value of F max 와비교검정 ) 2) Spearman's rank correlation - rank correlation between absolute residuals and predicted values 3) Levene's test - 절대오차값의 ANOVA 4) Bartlett's test ( 만약각 treatment 마다 sample size 가다를경우사용 ) - 등분산가정의기각이유 : 1) 집단간에본질적으로이미큰차이가있을경우. 2) 특정집단이다른집단에비해적용된실험에더큰분산을가질경우 3) 관측척도의부적절한선택 : 이경우자료의변환으로정정가능 등분산가정을충족시키기위한자료의변환 (Data Transformation) 관계 분포평균 (μ) 과표준편차 (σ) 평균 (μ) 과분산 (σ 2 ) 자료변환 정규독립적독립적필요없음 이항 semi-circle p=0 또는 1 일경우 σ 또는 σ 2 =0 그리고 p=1/2일때최대 log normal linear parabolic arcsin( ) 또는 arcsin( ) log Y 또는 log (Y+C) 포아송 parabolic linear 또는 - 2 -

3 그래픽관계 ( 각집단의평균과 residuals ( 각집단의관측치 - 각집단의평균 ) 의절대치 ) 잔차절대값 Residual( ) treatment means 예제 ) 5 가지살충제가사과나무벌레를제거하는정도를살피기위해각살충제를 5 자루의사과나무에살포한후약 4 주후에죽은사과나무벌레의수를측정하였다. 살충제종류 사과나무 A B C D E S S 평균 F max = S 2 max/s 2 min = 3557/71 =50.1 Critical value of F max (treatment 수, 각 treatment 의자유도 ) F max(5,4) = 25.2 < F max = 50.1 ( 등분산가정기각 ) - 3 -

4 residual( ) 과각 treatment 평균그래프를이용한등분산가정 검정및적절한자료의변환 자료의로그변환 (log transformation of data) 후등분산가정의재검정 살충제종류 사과나무 A B C D E S S 평균 F max = S 2 max/s 2 min =.0525/.0119 = 4.41 Critical value of F max (treatment 수, 각 treatment 의자유도 ) F max(5,4) = 25.2 > F max = 4.41 ( 등분산가정채택 ) - 4 -

5 residual( ) 과각 treatment 평균그래프를이용한등분산가정 재검정 ( 아래표출처 :

6 7. 추리통계가설검정 : 평균비교및비모수통계적용 * 가설검정의순서 1. 가설의설정 ( 영가설, 대립가설 ) 2. 유의수준 (α) 결정 3. 검정에사용할통계분포 (Z, t, χ 2, F, 등 ) 4. 표본으로부터검정통계치와 probability 계산 1) 실제분포에의한가설검정 : Sign, Fisher-Irwin, Wilcoxon... 동전놀이를통한가설검정 (binomial distribution) 동전을 10 번던져나온결과를가지고동전에대한판단을하면, 통계적가설 H 0 ( 영가설 ): P(H) = 1/2 ( 앞이나올확률 ) H A ( 대립가설 ): P(H) 1/2 (P(H)<1/2 and p(h)>1/2) ( 양방적검정 : two-tailed tests) 앞면수 p 확률 (probability) 10 10C 10 p 10 q 0 (1 (0.5) 10 (0.5) 0 ) = C 9 p 9 q 1 (10 (0.5) 9 (0.5) 1 ) = C 8 p 8 q 2 (45 (0.5) 8 (0.5) 2 ) = C 7 p 7 q 3 (120 (0.5) 7 (0.5) 3 ) = C 6 p 6 q 4 (210 (0.5) 6 (0.5) 4 ) = C 5 p 5 q 5 (252 (0.5) 5 (0.5) 5 ) = C 4 p 10 q 0 (210 (0.5) 4 (0.5) 6 ) = C 3 p 10 q 0 (120 (0.5) 3 (0.5) 7 ) = C 2 p 10 q 0 (45 (0.5) 2 (0.5) 8 ) = C 1 p 10 q 0 (10 (0.5) 1 (0.5) 9 ) = C 0 p 0 q 10 (1 (0.5) 0 (0.5) 10 ) = 기각역과채택역의설정 ( 유의수준으로결정보통 0.05 또는 0.01) 만약기각역을유의수준을 0.05 로설정하였다면확률이 0.05 이하로동전의앞면이나온수가 10, 9, 1, 0 는기각역이라한다. * if P-value (probability) > α (level of significance), 영가설을수락함 (accept). 그러나 if P-value (probability) α (level of significance), 영가설을기각함 (reject). 부호화검정 (sign test - nonparametric test) 조사된결과를부호화하여가설을검정하는통계적방법 - 두그룹 (paired - 6 -

7 또는 non-paired) 의결과를비교분석 예제 ) 유치원생에게수의개념이해를위하여답을맞추었을때사탕을주는방법과칭찬을하는두방법을사용한후, 두방법의차이를알고자한다. 동일유아에게사탕을주는방법과칭찬을하는두방법을모두사용한후, 테스트를실시하여답을맞춘문항수를비교그차이에따라기호를 (+) 와 (-) 로설정하였다. 이런부호화검정을위한통계적가설은다음과같다. 연구결과 H 0 ( 영가설 ): P(+) = P(-) = 1/2 H A ( 대립가설 ): P(+) P(-) 1/2 유아 사탕 칭찬 차이 부호 유의수준 (0.05) 을결정하여부호화검정에따라기각과채택여부검정. 위의동전놀이경우처럼각부호가나올숫자의확률을구하여확률에따라설정한유의수준에따른기각과채택여부결정함. (> 0.05) + 부호가 5 개나올확률이유의수준보다크기에유아들의수개념학습에있어사탕에의한강화와칭찬에의한강화의차이는없다고결론을내릴수있다. 부호 (non-parametric) 와그차이의양을고려하기위하여는 Wilcoxon matched pairs test 를사용하여검정. 두그룹의 nonparamatric unparied 부호화결과는 Mann-Whitney test( 또는 Wilcoxon rank-sum test) 로검정. matched 3 그룹이상을비교할시에는 Friedman test (unmatched 3 그룹은 Kruskal-Wallis test 로검정. Wilcoxon matched pairs test (SPSS program) - 7 -

8 The Wilcoxon matched pairs compares two matched groups, without assuming that the distribution of the before-after differences follows a Gaussian distribution. Look elsewhere if you want to perform the paired t test. Beware: Wilcoxon's name is used on two different tests. The test usually called the Mann-Whitney test is also called the Wilcoxon rank-sum test. It compares two groups of unpaired data. 1. Open SPSS prog. File New (or Open) Data 2. Open Variable View Type in variable name, type( 자료유형 : 숫자, 문자등 ), measures( 자료유형에따라선정 ) * 메뉴의 Help 참조 - 8 -

9 3. Data view 로이동 각 variable 의자료입력 메뉴에서 Analysis 에서 Nonparametric Tests Legacy Dialogs 2 Related Samples 4. Select Test Pairs Choose the Wilcoxon click OK - 9 -

10 5. Pop-up Ootput screen review the results 6. Polish the graph A before-after graph shows all the data. This example plots each subject as an arrow to clearly show the direction from 'before' to 'after', but you may prefer to plot just lines, or lines with symbols

11 Avoid using a bar graph, since it can only show the mean and SD of each group, and not the individual changes. To add the asterisks representing significance level copy from the results table and paste onto the graph. This creates a live link, so if you edit or replace the data, the number of asterisks may change (or change to 'ns'). Use the drawing tool to add the line below the asterisks, then right-click and set the arrow heads to "half tick down'. Interpreting the P value The Wilcoxon test is a nonparametric test that compares two paired groups. If the two sums of ranks are very different, the P value will be small. Checklist - Pairs independancy ( 하나의대상에대해두번이상측정한경우는상호영향!) - P value 가 0.05 이상으로클경우, 이 paired 분석이타당한지재검토필요. - 정확히두그룹간의비교인지재확인 ( 여러그룹에서두그룹간의비교를여러번시행하지말것!) - 일방적또는양방적검정인지재확인 - 표본이 non-gaussian 분포로부터의인지확인 ( 만약 Gaussian 분포로부터올경우표본수가적을경우검정의정확도의신뢰도가낮음 ) 그리고만약분포가벨모양이아닐경우자료변환을통해 Gaussian 분포를만족한후 t-test 수행필요 - 본통계검정은두그룹간의차이가중앙값 (median) 을중심으로대칭적으로분포하는것으로가정하고실시함. Mann-Whitney test The Mann-Whitney test is a nonparametric test that compares the distributions of two unmatched groups. Look elsewhere if you want to compare three or more groups with the Kruskal-Wallis test, or perform the parametric unpaired t test. This test is also called the Wilcoxon rank sum test. Don't confuse it with the Wilcoxon matched pairs test, which is used when the values are paired or the Wilcoxon signed-rank test which compares a median with a hypothetical value. 1. Open SPSS prog. File New (or Open) Data ( 위에참조 ) 2. Open Variable View Type in variable name, value( 성별과같이명명자료일경우 숫자로전환 ), type( 자료유형 : 숫자, 문자등 ), measures( 자료유형에따라선정 ) * 메뉴의 Help 참조

12 3. Data view 로이동 각 variable 의자료입력 메뉴에서 Analysis 에서 Nonparametric Tests Legacy Dialogs 2 Independent Samples 4. Select Test Variable Grouping Variable and degine groups (group1 = 1, group 2=2) Choose Mann-Whitney U click OK 5. Pop-up Ootput screen review the results

13 6. Polish the graph Graphing notes: A scatter plot shows every point. If you have more than several hundred points, a scatter plot can become messy, so it makes sense to plot a box-and-whiskers graph instead. We suggest avoiding bar graphs, as they show less information than a scatter plot, yet are no easier to comprehend. The horizontal lines mark the medians. To add the asterisks representing significance level copy from the results table and present onto the graph. Interpreting results: Mann-Whitney test P value The Mann-Whitney test, also called the rank sum test, is a nonparametric test that compares two unpaired groups. For the Mann-Whitney test, the smallest number gets a rank of 1. The largest number gets a rank of N, where N is the total number of values in the two groups. Then sums the ranks in each group, and reports the two sums. If the sums of the ranks are very different, the P value will be small. If the P value is small, you can reject the idea that the difference is due to random sampling, and conclude instead that the populations have different medians. If the P value is large, the data do not give you any reason to conclude that the overall medians differ. This is not the same as saying that the medians are the same. You just have no compelling evidence that they differ. If you have small samples, the Mann-Whitney test has little power. In fact, if the total sample size is seven or less, the Mann-Whitney test will always give a P value greater than 0.05 no matter how much the groups differ. If you have large sample sizes and a few ties, no problem. But with small data sets or lots of ties, we're not sure how meaningful the P values are. One alternative:

14 Divide your response into a few categories, such as low, medium and high. Then use a chi-square test to compare the two groups. The Mann-Whitney test doesn't really compare medians You'll sometimes read that the Mann-Whitney test compares the medians of two groups. But this is not exactly true, as this example demonstrates. The graph shows each value obtained from control and treated subjects. The two-tail P value from the Mann-Whitney test is , so you conclude that there is a statistically significant difference between the groups. But the two medians, shown by the horizontal lines, are identical. The Mann-Whitney test compared the distributions of ranks, which is quite different in the two groups. It is not correct, however, to say that the Mann-Whitney test asks whether the two groups come from populations with different distributions. The two groups in the graph below clearly come from different distributions, but the P value from the Mann-Whitney test is high (0.46)

15 The Mann-Whitney test compares sums of ranks - it does not compare medians and does not compare distributions. To interpret the test as being a comparison of medians, you have to make an additional assumption - that the distributions of the two populations have the same shape, even if they are shifted (have different medians). With this assumption, if you reject the Mann-Whitney test reports a small P value, you can conclude that the medians are different. If you want to compare three or more groups, use the Kruskal-Wallis test. 1. Open SPSS prog. File New (or Open) Data ( 위에참조 ) 2. Open Variable View Type in variable name, value( 성별과같이명명자료일경우숫자로전환 ), type( 자료유형 : 숫자, 문자등 ), measures( 자료유형에따라선정 ) * 메뉴의 Help 참조 3. Data view 로이동 각 variable 의자료입력 메뉴에서 Analysis 에서 Nonparametric Tests Legacy Dialogs K-Independent (paired 일경우는 Related) Samples

16 4. Select Test Variable Grouping Variable and define groups (minimum = 1, maximum = 5) Choose Kruskal-Wallis H click OK 5. Pop-up Ootput screen review the results

17 Irwin-Fisher ( 또는 Fisher's exact) 검정 - 변수들이이분질적변수일때두집단에서연구대상이되는비율이같은지를검정 ( 예, 기독교인과비기독교인이제사에대하여찬성하는비율의차이연구 ) 빈도표가사용됨. 예 ) 성별에따른운전면허획득비율에차이가있는지알아보기위해남자 40 명과여자 20 명을무선추출하여유의수준 0.05 에서검정. 통계적영가설과대립가설은 : 성별 남여 total 운전면허 획득 8 (A) 2 (B) 10 미획득 32 (C) 18 (D) (N) 유의수준 0.05 에서양방적검정 (two-tailed test) 이므로양극단으로부터누적확률이.025 를넘지않는도수가기각역이된다. ( 표 14-5 참조 ) 그러므로위결과는영가설을기각하지못하여운전면호획득비율은성별에따라유의한차이가없다고결론내릴수있다

18 * 참조 : 에서 Frequency data 에서 2x2 Table of cross-categorized frequency data Version 1 으로자동계산가능!