Ageda: Recap. Lecture. Chapter Homework. Chapt #,, 3 SAS Problems 3 & 4 by had. Copyright 06 by D.B. Rowe
Recap.
6: Statistical Iferece: Procedures for μ -μ 6. Statistical Iferece Cocerig μ -μ Recall yes Variaces kow? Idepedet populatios? o Case 4 yes Case Z Case o F test Case 3 30 Z 30 t, 30, 30, 30, 30 Z t Z t 3
6: Statistical Iferece: Procedures for μ -μ 6. Statistical Iferece Cocerig μ -μ Depedet Populatios: Case 4: Test Statistic Cofidece Iterval & ukow 30 s X 30 Z d d d Xd Z / s / & ukow 30 30 df t X d / d d s d X i d t / di X i X i Xd di sd ( d ) i X d s d i 4
: Noparametric Tests. The Sig Test (Two depedet Samples Test) If d i s are ot N(μ d,σ ), & <30 the we kow that X d is ot N(μ d,σ /), o CLT, ad that X d X d d μ d is ot N(0,σ ), o CLT, ad that / ( ) s X d d t= s / d d is ot N(0,), o CLT, ad that is ot χ (-), but approximately ~t(-)! Studies have show that if X i s are from moud shaped dist, the approximatio ot bad. This used i Chapt 6 Case 4 Robust to mild departures from ormality. 5
: Noparametric Tests. The Sig Test (Two depedet Samples Test) For the Sig Test, we still calculate differeces d i =X i X i, but ot the sample mea, X d. We determie whether the differeces are positive +, egative, or zero 0. If the medias of the two distributios are truly the same, the we should have a similar allocatio of + ad. d i i 6
: Noparametric Tests. The Sig Test (Two depedet Samples Test) H 0 : p=( or )0.5 (this is a media test). Let X be the umber of + sigs. If there is o differece i medias, i.e. H 0 true, the X has a biomial distributio with p=0.5. Sigificace from biomial. Assumptios For Test:. d i s are idepedet (each trial idepedet). d i s from same distributio (p ot chagig) 7
: Noparametric Tests. The Sig Test (Two depedet Samples Test) If the medias of the two distributios are truly the same, the we should have a similar allocatio of + ad. Example.: Pre/Post Blood Pressures H 0 : p 0.5, =0, x=7. Assume H 0 true. How likely is it to observe 7 or more successes out of 0 whe p=0.5? P(X 7)=0.79. Reject H 0 if p-value 0.05. p-value 8
: Noparametric Tests. The Sig Test (Two depedet Samples Test) Example.: was H 0 : p 0.5 vs. H 0 : p>0.5. by calculatig P(X x), reject H 0 if p-value<α. p-value But we ca also test H 0 : p 0.5 vs. H 0 : p<0.5. by calculatig P(X x), reject H 0 if p-value<α. p-value But we ca also test H 0 : p=0.5 vs. H 0 : p 0.5. by calculatig P(X x)+p(x x), reject H 0 if p-value<α. p-value 9
: Noparametric Tests. The Wilcoxo Siged-Rak Test (Two Depedet Samples Test) Example.: Pre/Post Blood Pressures H 0 : p 0.5, =0, x=7. Assume H 0 true. T=40.5. The max possible T is 45. ad the media is.5. Sice T>37, reject H 0! 0
: Noparametric Tests. The Wilcoxo Siged-Rak Test (Two Depedet Samples Test) Geerally the exact critical value table is ot used, a approximate Z statistic is used, Z ( ) T 4 ( )( ) 4 ad the usual ormal Z table is used. ( ) ET ( ) ( )( ) var( T) 4 6
: Noparametric Tests. The Wilcoxo Siged-Rak Test Example.: Pre/Post Blood Pressures H 0 : p 0.5, =0, x=7. Assume H 0 true. T=40.5. The media is.5. (Two Depedet Samples Test) Z ( ) T 4 ( )( ) 4 Z 40.5.5 9(9 )( 9 ) 4.3 Sice Z>.645, reject H 0!
Chapter : Noparametric Tests Daiel B. Rowe, Ph.D. Departmet of Mathematics, Statistics, ad Computer Sciece 3
6: Statistical Iferece: Procedures for μ -μ Itroductio Recall X Four Cases: Case. Two idepedet populatios populatio variaces are kow, ( & kow & ). Case. Two idepedet populatios populatio variaces are ukow but assumed to be equal, ( & ukow & =). Case 3. Two idepedet populatios populatio variaces ukow ad possibly uequal, ( & ukow & ). Case 4. Two depedet populatios data are assumed to be matched or paired ( & kow or ukow). 4
6: Statistical Iferece: Procedures for μ -μ 6. Statistical Iferece Cocerig μ -μ Recall yes Variaces kow? Idepedet populatios? o Case 4 yes Case Z Case o F test Case 3 30 Z 30 t, 30, 30, 30, 30 Z t Z t 5
6: Statistical Iferece: Procedures for μ -μ 6. Statistical Iferece Cocerig μ -μ Recall Idepedet Populatios: Case : Test Statistic & ukow X X Z 30 30 S p & ukow 30 30 ( ) ( ) ( X X) ( ) t S p S df ( ) s ( ) s P 6
6: Statistical Iferece: Procedures for μ -μ 6. Statistical Iferece Cocerig μ -μ Recall Idepedet Populatios: Case 3: Test Statistic & ukow X X 30 Z s s 30 & ukow 30 30 ( ) ( ) ( X X) ( ) t s s Next larger umber s s df s / s / 7
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) We kow that if X i s~n(μ, ) & X i s~n(μ, ), the we kow X ~N(μ, / ) & X~N(μ, / ), ad Case :, 30 ( X X ) ~ N(( ), / / ), ad ( X X ) ( ) ~ N(0, / / ), ad ( X X) ( ) ~ N (0,), ad 8
: Noparametric Tests.3 The Wilcoxo Rak Sum Test idepedet that ( X X) ( ) ~ N (0,) s ( ) ( ) s (Two Idepedet Samples Test) ~ ( ), ad ~ ( ), ad, ad Case : ( ) s ( ) s ~ ( ), 30 9
: Noparametric Tests.3 The Wilcoxo Rak Sum Test that (Two Idepedet Samples Test) ( X X) ( ) ~ N (0,) Case :, ad, 30 ( ) s ( ) s ( X X) ( ) ~ ( ) t t Z S p ~ ( ) S if large. ( ) s ( ) s P 0
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) If X i s ot~n(μ, ) & X i s ot~n(μ, ), the X Case : ot~n(μ, / ) & X ot~n(μ, / ), ad, 30 ( X X ) ot ~ N(( ), / / ), ad ( X X ) ( ) ot ~ N(0, / / ), ad ( X X ) ( ) ot ~ N(0,), ad
: Noparametric Tests.3 The Wilcoxo Rak Sum Test idepedet (Two Idepedet Samples Test) ( X X ) ( ) that ot ~ N(0,), ad ( ) s ( ) s ot ( ) s ( ) s ~ ( ), ad ot ~ ( ), ad ot Case : ~ ( ), 30
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) ( X X ) ( ) that ot ~ N(0,), ad, 30 ( ) s ( ) s ot ~ ( ), but approximately ( X X) ( ) t ~ t ( ) S p Case : Studies have show that if X i s are from moud shaped dist, the approximatio ot bad. This used i Chapt 6 Case 3
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) Whe & <30 ad we are cocered that ( X X) ( ) t does ot have a Studet-t distributio, S p the we eed to resort to a oparametric test. H 0 : MD MD =0 ot H 0 : µ -µ =0 Case :, 30 4
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) For the Wilcoxo Rak Sum Test with ad, Rak all the observatios i icreasig order. Assig ties their average rak. Let S=the sum of the raks for the sample of size. The sum of all raks is (+)/, = +. If there is o differece, the we expect some small ad some large raks so S (+)/4! 5
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) S=the sum of the raks for the sample of size. Table Not i Book. http://faculty.fiu.edu/~mcguckd/wilcoxo%0rak%0sum%0table.pdf 6
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) Example.3: Health Status H 0 : MD MD =0 H : MD MD 0 α=0.05 S =6 S =0 If there is o differece, the we expect to see some low ad some high raks i each group. Sum of all raks=36. Expect S 8. S=6. Accordig to the Table, sice S 5, do ot reject. 7
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) Geerally the exact critical value table is ot used, a approximate Z statistic is used, Z ( ) S ( ) ad the usual ormal Z table is used. E( S) ( ) ( ) var( S) 4 3 8
: Noparametric Tests.3 The Wilcoxo Rak Sum Test (Two Idepedet Samples Test) Example.3: Health Status H 0 : MD MD =0 H : MD MD 0 α=0.05 4(4 4 ) 6 Z 0.58 4 4(4 4 ) We kow that sice Z <.96, do ot reject. Z ( ) S ( ) 9
9: Aalysis of Variace Recall ANOVA is a geeralizatio of these methods ad is for testig for differeces i three or more populatio meas. i.e. H 0 : μ = μ = μ 3 H : meas ot all equal (at least two are differet) (Ca be ad ; or ad 3 ; or ad 3 ; or,, ad 3 ) More geerally, H 0 : μ = μ = = μ k, k is # of populatio meas comparig H : meas ot all equal (at least two are differet) I ANOVA there are o iequality hypotheses. No vs > or vs <. 30
9: Aalysis of Variace X X Assumptios for valid applicatio of ANOVA ) k idepedet populatios ) Radom samples from each of k > populatios 3) Large samples ( i 30) or ormal populatios 4) Equal populatio variaces k 3
: Noparametric Tests.4 The Kruskal-Wallis Test (k Idepedet Samples Test) The K-W Test is a oparametric alterative to ANOVA. Rak all the observatios ad replace by raks, R ij. Assig ties their average rak. rak i i populatio j Let R i =the sum of the raks for the ith sample of size i. k R. ( ) i k ( ) H i s Rij s i i 4 i j 4 Reject H 0 for large H. If there ( ) s are o ties 3
: Noparametric Tests.4 The Kruskal-Wallis Test (k Idepedet Samples Test) The K-W Test is a oparametric alterative to ANOVA. There are exact tables available that deped o k ad i s. http://faculty.virgiia.edu/kruskal-wallis/ 33
: Noparametric Tests.4 The Kruskal-Wallis Test (k Idepedet Samples Test) The K-W Test is a oparametric alterative to ANOVA. H 0 : MD =MD =MD 3 =MD 4, H : At least two MDs. H 0.703 CV 7.38 Reject H 0, at least two MDs. R ( ) k. i H s i i 4 s k i k i Rij i j s R. ( ) i 349. i 4 ( ) 4 3.636 34
: Noparametric Tests.4 The Kruskal-Wallis Test (k Idepedet Samples Test) Geerally the exact critical value table is ot used. If the i are 5, the H has a approximate χ distributio uder the ull hypothesis. H k R. ( ) i s i i 4 ad the usual χ table is used. Reject H 0 if H> ( k ). ~ ( k ) 35
: Noparametric Tests.4 The Kruskal-Wallis Test (k Idepedet Samples Test) The K-W Test is a oparametric alterative to ANOVA. R ( ) k. i H s i i 4 H 0 : MD =MD =MD 3 =MD 4, H : At least two. H 0.703 ( k ) 7.8 Reject H 0, at least two MDs. s 3.636 36
0: Correlatio ad Regressio 0. Correlatio Aalysis 0.. The Sample Correlatio Coefficiet Recall The sample correlatio is r also give by r cov( XY, ) var( X) var( Y) ( x y ) ( x )( y ) i i i i i i i [ ( xi ) ( xi ) ][ ( yi ) ( yi ) ] i i i i cov( X, Y) ( X i X )( Yi Y ) i var( X ) ( X i X ) i var( Y) ( Yi Y ) i 37
: Noparametric Tests.5 Spearma Correlatio (Correlatio Betwee Variables) The Spearma rak correlatio betwee X ad Y is to covert the actual observed values to raks R X ad R y, the calculate the correlatio betwee R X ad R y. r s cov( R, R ) x var( R ) var( R ) x y y cov( R, R ) ( R R )( R R ) x y xi x yi y i var( R ) ( R R ) x xi x i var( R ) ( R R ) y yi y i 38
: Noparametric Tests.5 Spearma Correlatio (Correlatio Betwee Variables) We ca perform a hypothesis test o r s. H 0 : ρ s =0 vs. ρ s 0. r s cov( R, R ) x var( R ) var( R ) x y y Reject H 0 if r s large. 39
: Noparametric Tests.5 Spearma Correlatio There is a exact table. r s cov( R, R ) x var( R ) var( R ) x y y https://www.york.ac.uk/depts/maths/tables/spearma.pdf 40
: Noparametric Tests.5 Spearma Correlatio But the exact table is ot geerally used. t r ~ ( ) s t r s H 0 : ρ s = 0 vs. H : ρ s 0, α=0.05 Reject if t >t.05 (df-) 4
: Noparametric Tests Questios? Homework: Chapter #,, 3, SAS Problems 3 & 4 by had. 4