Tetig Hypothee COMPARISONS INVOLVING TWO SAMPLE MEANS Two type of hypothee:. H o : Null Hypothei - hypothei of o differece. or 0. H A : Alterate Hypothei hypothei of differece. or 0 Two-tail v. Oe-tail Tet Two-tail tet have thee type of hypothee: H o : H A : Note the preece of the equal ig. If you reject H o :, you do t care which mea i greater. ca be either greater tha or le tha. Oe-tail tet my have oe of the followig type of hypothee: H o : H o : H A : H A : t-ditributio Note the preece of greater tha or le tha ig. If you reject Ho:, you are beig pecific that ca oly be o oe ide of. / / Two-tail tet Oe-tail tet Size of the rejectio regio = / Size of the rejectio regio =
Type of Error. Type I Error: To reject the ull hypothei whe it i actually true. The probability of committig a Type I Error i. The probability of committig a Type I Error ca be reduced by the ivetigator chooig a maller. typical ize of are 0.05 ad 0.0. The probability of committig a Type I Error alo ca be expreed a a percetage (i.e. *00 %) If =0.05, The probability of committig a Type I Error i 5%. If =0.05, we are tetig the hypothei at the 95% level of cofidece.. Type II Error: The failure to reject the ull hypothei whe it i fale. The probability of committig a Type II Error i. ca be decreaed by: a. Icreaig (i.e. the umber of obervatio per treatmet). b. Decreaig. Icreae Chooe a more appropriate experimetal deig Improve experimetal techique. Power of the Tet Power of the tet i equal to: -. Defied a the probability of acceptig the alterate hypothei whe it i true. We wat the Power of the Tet to be a large a poible. Summary of Type I ad Type II Error True Situatio Deciio Null hypothei i true Null hypothei if fale Reject the ull hypothei Type I Error No error Fail to reject the ull hypothei No error Type II Error
Hypothei Tetig Summary of Tetig a Hypothei.. Formulate a meaigful ull ad alterate hypothei.. Chooe a level of. 3. Compute the value for the tet tatitic (i.e. t-tatitic of F-tatitic). 4. Look up the appropriate table value for the tet tatitic. 5. Formulate cocluio. a. If the tabular tatitic > calculated tatitic, the you fail to reject H o. b. If the tabular tatitic < calculated tatitic, the you reject H o. Compario of Two Sample Mea (t-tet) Suppoe we have two populatio mea of ad we wat to tet the hypothei: H o : H A : Thi ca be doe uig a t-tet where: Y Y t Y Y Where: Y = mea of treatmet Y = mea of treatmet Y Y = tadard deviatio of the differece betwee two mea. Calculatio of Y deped o three thig. Y. Do the populatio have a commo variace (i.e.. Are the two ample of equal ize (i.e. = )? 3. Are the obervatio meaigfully paired? *Compario of Two Sample Mea ( = ) ad Give the followig data: )? Y i Y i Treatmet 7 9 0 6 9 7 48 396 Treatmet 5 3 5 8 68 Determie if the treatmet mea are igificatly differet at the 95% level of cofidece. Step. Write the hypothei to be teted:
H o : H A : Step. Calculate & 48 396 6 6 8 68 6 6.8.4 Step. Tet to ee if the two variace are homogeeou (i.e. H o : ). The method of calculatig H o :. Y will deped o whether you reject or fail to reject Y If you fail to reject H o :, the formula for Y i: Y Y Y p where: p = the pooled variace ad = the umber of obervatio i a treatmet total. If you reject H o :, the formula for Y i: Y Y Y where: = variace of Treatmet = variace of Treatmet = umber of obervatio for treatmet = umber of obervatio for treatmet
Tet H o : uig a F-tet where: Larg er F Smaller If there are large differece betwee &, F will become large ad reult i the rejectio of H o :. We will be tetig the hypothei H o : at the 95% level of cofidece. Thi F-tet i a two-tail tet becaue we are ot pecifyig which variace i expected to be larger. Thu, if you are tetig / = 0.05, the you eed to ue the F-table for α = 0.05 (Appedix Table IV, page 6). Thi ituatio (i.e. tetig H o : ) will be the oly oe ued thi emeter i which the F-tet i a two-tail tet. Whe we ue a F-tet to tet H o :, thi will be a oe-tail F-tet becaue the umerator of the tet, the variace baed o mea ( r T ), i expected to be larger tha the deomiator, the variace baed o idividual obervatio ( ). Thi oe-tail F-tet require ue of Appedix Table IV o page 60..8 For thi problem F. 67.4 Step. Look up table F-value i Appedix Table IV (page 6). F,( ),( ) = F alpha value/; umerator df, deomiator df / The table i our text i et up for oe-tail tet. Thu, to ue the table for a twotail tet ad you wat to tet at the 0.05 level, you eed to look up the value of 0.005 i the table. The area uder each of the two-tail i 0.05. For thi problem the table F for F 0.05/;5,5 =7.5.
Step.3 Make cocluio: Sice the calculated value of F (.67) i le tha the Table-F value (7.5), we fail to reject H o : at the 95% level of cofidece. Therefore, we ca calculate Y uig the formula: Y Y Y p Step 3. Calculate p The followig formula will work i or p ( ) ( ( ) ( ) ) where: = variace of Treatmet = variace of Treatmet = umber of obervatio for treatmet = umber of obervatio for treatmet If, you ca calculate p (.4.8) For thi problem p. 6 Step 4. Calculate Y Y p uig the formula The followig formula will work i or Y p ( Y ) If, you ca calculate Y uig the formula: Y p Where = the umber of obervatio i a treatmet total. Y Y
(.6) For thi problem 0. 9309 Y Y 6 Step 5. Calculate t-tatitic Y Y t Y Y 48 8 t 6 6 0.9309 5/ 0.9309 5.37 Step 6. Look up table t-value. df= ) ( ) =(6-)+(6-)=0 ( t.05/;0df =.8 Step 6. Make cocluio. -8.8 5.37 Sice t-calc (5.37) i > t-table (.8) we reject H o : at the 95% level of cofidece. Thu we ca coclude that the mea of treatmet i igificatly differet tha that of the mea of treatmet at the 95% level of cofidece.
Compario of Two Sample Mea (Cofidece Iterval) The formula for a cofidece iterval to tet the hypothei: H o : i: ( Y Y ) t Y Y Uig the data from the previou example: ( Y Y ) t Y Y (8 3).8(0.93) 5.07 l l.93 7.07 Sice the iterval doe ot iclude the value 0, we mut reject H o : at the 95% level of cofidece. Compario of Two Sample Mea (F-tet) H o : I coductig tet of igificace for: H A : tet of variace (i.e. the ratio of two variace. we actually are coductig a F- F= etimate of σ baed o mea etimate of σ baed o idividual r = T Whe the ull hypothei i rejected, the umerator of the F-tet become large a compared to the deomiator. Thi caue the calculated vale for F to become large. So far i cla we have ee two differet way to etimate. Y / : We ca etimate by * (i.e. variace baed o mea).. We ca etimate idividual). by calculatig Y directly from idividual (variace baed o
The etimate of Y effect approache oly whe you fail to reject H o : becaue the treatmet r T i the expected mea quare for the treatmet ource of variatio ( r T ) approache zero. Whe H o : i rejected ad the treatmet variace are homogeou (i.e. ), the etimate of baed o mea will over etimate. Thi occur becaue the etimate of baed o mea i affected by differece betwee treatmet mea a well a differece due to radom chace. The etimate of baed o idividual i ot affected by differece betwee treatmet mea. Note i the model below that the model for obervatio baed o idividual doe ot have a compoet for treatmet. Thi ca be ee by lookig at the liear model.. Liear model for obervatio baed o idividual. Yi i Where: Y i = the i th obervatio of variable Y. populatio mea. i = radom error. Liear model for ample from two or more treatmet. Yij i ij Where: Y ij = the j th obervatio of the i th treatmet. populatio mea. i = the i th treatmet = radom error ij We ca etimate baed o mea by calculatig a value called the Treatmet Mea Square (TRT MS). We ca etimate baed o idividual by calculatig a value called the Error Mea Square.
Give the liear model Yij i ij, we ca rewrite the compoet a: ca be rewritte a Y.. ca be rewritte a Y i. Y.. i ca be rewritte a Y. ij ij Y i SOV Df SS MS F Amog trt (Trt) t- r ( Y i. Y..) Trt SS/Trt df Trt MS/Error MS Withi trt (Error) t(r-) ( Y Y i.) Error SS/Error df Total tr- ( Y ij Y..) r = umber of replicate t = umber of treatmet Example Uig the data from the previou t-tet ad CI problem ij Y i. Y i Treatmet 7 9 0 6 9 7 48 396 Treatmet 5 3 5 8 68 Y..=66 Step. Calculate the Total SS Y ij Total SS= ( Yij Y..) Y Correctio factor ij rt Defiitio formula Workig formula =(7 + 9 + 0 +... + ) - 66 /(6*) = 464 363 = 0
Step. Calculate Trt SS Y Y i. ij Trt SS= r ( Y i. Y..) Correctio factor r rt Defiitio formula Workig formula 48 8 ( 6 6 438 363 66 ) 75 Step 3. Calculate Error SS Yi. 48 8 Direct Method: Error SS= ( Y ij ) (396 ) (68 ) 6 r 6 6 i Idirect Method: Error SS = Total SS Trt SS = 0-75 = 6 j Step 4. Complete the ANOVA Table SOV Df SS MS F Trt (t-) = 75.0 75.0 8.85 ** Error t(r-) = 0 6.0.6 Total rt- = Thi Error MS i the ame value a p i the t-tet. Thi i the etimate of (i.e. ). Step 5. Look up the Table F-value. *,** Sigificat at the 95% ad 99% level of cofidece, repectively. F α; umerator df, deomiator df = F α; treatmet df, error df F 0.05;,0 = 4.96 F 0.0;,0 = 0.04
Step 6. Make cocluio. Sice F-calc (8.85) > 4.96 we reject Ho: at the 95% level of cofidece. Sice F-calc (8.85) > 0.04 we reject Ho: at the 99% level of cofidece. 0 4.96 0.04 8.85 Relatiohip Betwee the t-tatitic ad the F-tatitic Whe, t = F. Compario of Two Sample Mea ( ) ad Give the followig data: Y i Y i Treatmet 3 9 6 0 8 6 Treatmet 5 9 3 7 884 Determie if the treatmet mea are igificatly differet at the 95% level of cofidece. Step. Write the hypothei to be teted: H o : H A : Step. Calculate & 8 6 4 4 7 884 6 6 0 4
Step. Tet to ee if the two variace are homogeeou (i.e. H o : ). Larg er F Smaller 0 For thi problem F. 5 4 Step. Look up table F-value i Appedix Table IV (page 6). F,( ),( ) = F alpha value/; umerator df, deomiator df / For thi problem the table F for F 0.05/;3,5= 7.76. Step.3 Make cocluio: Sice the calculated value of F (.5) i le tha the Table-F value (7.76), we fail to reject H o : at the 95% level of cofidece. Therefore, we ca calculate Y uig the formula: Y Step 3. Calculate p p ( ) ( ( ) ( Y p ( Y ) ) ) where: = variace of Treatmet = variace of Treatmet = umber of obervatio for treatmet = umber of obervatio for treatmet p (4 )0 (6 )4 6.5 (4 ) (6 )
Step 4. Calculate Y Y Y Y p ( ) 6.5.64 4 6 Step 5. Calculate t-tatitic Y Y t Y Y 7 t.64 3.098 May people do t lie workig with egative t-value. If you are coductig a two-tail tet, you ca work with the abolute value of t ice the rejectio regio are ymmetrical about the axi of 0. Therefore, 3.098 3. 098 Step 6. Look up table t-value. Df= ) ( ) =(4-)+(6-)=8 ( t.05/;8df =.306 Step 6. Make cocluio. -306.306 3.098 Sice t-calc (3.098) i > t-table (.306) we reject H o : at the 95% level of cofidece. Thu we ca coclude that the mea of treatmet i igificatly differet tha that of the mea of treatmet at the 95% level of cofidece.
Compario of Two Sample Mea ( = or ) ad Give the followig data: Y Y i i Treatmet 5.9 3.8 6.5 8.3 8. 6. 7.6 330.60 46.4 Treatmet 7.6 6.4 4. 6. 6.5 4. 7.7 84.3.6 Determie if the treatmet mea are igificatly differet at the 95% level of cofidece. Step. Write the hypothei to be teted: H o : H A : Step. Calculate & 46.4 330.6 7 7.6 84.3 7 7 40..8 Step. Tet to ee if the two variace are homogeeou (i.e. H o : ). 40. F 8. 4.8 Step. Look up table F-value. F 0.05/;6,6=5.8.
Step.3 Make cocluio: Sice the calculated value of F (8.4) i greater tha the Table-F value (5.8), we reject H o : at the 99% level of cofidece. Therefore, we have to calculate Y uig the formula: Y Y Y Step 3. Calculate Y Y Y Y 40. 7.8 7.458 Step 4. Calculate t -tatitic Ue t becaue t i thi cae i ot ditributed trictly a Studet t. Y t' Y Y Y 46.4.6 t' 7 7.458.964
Step 5. Calculate effective degree of freedom. Calculatio of the effective df allow u to ue the t-table to look up value to tet t. Effective df = 6.65 0.06) (5.475 36.56 7 7.8 7 7 40. 7.8 7 40. We ca roud the effective degree of freedom of 6.65 to 7.0. We the look up the t-value with 7 df. t.05/; 7df =.365 Step 6. Make cocluio. -.365.964.365 Paired Compario Earlier it wa tated that calculatio of Y Y deped o three thig: 4. Do the populatio have a commo variace (i.e. )? 5. Are the two ample of equal ize (i.e. = )? 6. Are the obervatio meaigfully paired? We will ow dicu the coequece of uig paired compario. Sice t -calc (.964) i < t-table (.365) we fail to reject H o : at the 95% level of cofidece. Thu we ca coclude that the mea of treatmet i ot igificatly differet tha that of the mea of treatmet at the 95% level of cofidece.
Pairig of obervatio i doe before the experimet i coducted. Pairig i doe to make the tet of igificace more powerful. If member of a pair ted to be large or mall together, it may be poible to detect maller differece betwee treatmet tha would be poible without pairig. The purpoe of pairig i to elimiate a outide ource of variatio, that exitig from pair to pair. Calculatig the variace of differece rather tha the variace of idividual cotrol the variatio. Example where pairig may be ueful: Drug or feed tudie o the ame aimal. Meauremet doe o the ame idividual at differet time (before ad after type treatmet). Y t. Y. D D D where D D D Y j Y j = the umber of pair. D D D D Y j Y j Y j Y j D D
Example Replicate Treatmet Treatmet Differece (D) Differece (D ) 8-4 6 7-5 5 3 3 6-3 9 4 0 6-6 36 5 5 9-4 6 Y. 48 Y. 70 D D 0 Step. Calculate D D D D 0 5 5.4 Step. Calculate D D.4 5 0.50 Step 3. Calculate t-value t D D /5 0.50 4.4 8.67 0.50 Step 4. Look up Table t-value df = umber of pair t / ; df t.05/ ;4.776
Step 5. Make cocluio -8.67 -.776.776 Sice t-calc (-8.67) i < t-table (-.776) we reject H o : at the 95% level of cofidece. Thu we ca coclude that the mea of treatmet i igificatly differet tha that of the mea of treatmet at the 95% level of cofidece. REVIEW You might be thikig there are may formula to remember; however, there are ome imple way to remember them. We have talked about four type of variace: = variace baed o idividual = variace baed o mea Y Y = variace of the differece betwee two mea Y = variace of paired obervatio D However, there i a relatiohip betwee all four variace that ca help you i rememberig the formula: / Y / D Y Y /
There are oly two formula for t: Y ad 0 t Y Y Y t Y Y You will eed to remember how to calculate ad Y. Y Y ( ) ( ) p regardle if or ( ) ( ) ( ) p regardle if Y Y or SAS Commad for the t-tet t-tet with equal variace optio pageo=; data ttet; iput trt yield; datalie; 7 9 0 6 9 7 5 3 5 ; proc ort; by trt; ru; proc ttet; cla trt; title 't-tet with equal variace'; ru;
t-tet with uequal variace optio pageo=; data uequ; iput trt yield; datalie; 5.9 3.8 6.5 8.3 8. 6. 7.6 7.6 6.4 4. 6. 6.5 4. 7.7 ;; proc ort; by trt; ru; proc ttet; cla trt; title 't-tet with uequal variace'; ru; Paired t-tet optio pageo=; data paired; iput a b; datalie; 8 7 3 6 0 6 5 9 ;; proc ttet; paired a*b; title 'paired t-tet'; ru;
T-tet to compare Treatmet ad (Equal variace) The TTEST Procedure Variable Trt N Lower CL Mea Mea Upper CL Mea Statitic Lower CL Std Dev Std Dev Upper CL Std Dev Std Err Yield 6 6.37 8 9.6 0.96.54 3.79 0.63 6 0 Yield 6.4 3 4.75.04.67 4. 0.68 5 Yield Diff (-).9 5 7.07..6.8 0.93 Miimum Maximum T-Tet Variable Method Variace DF t Value Pr > t Yield Pooled Equal 0 5.37 0.0003 Yield Satterthwaite Uequal 9.94 5.37 0.0003 Equality of Variace Variable Method Num DF De DF F Value Pr > F Yield Folded F 5 5.7 0.8698 If the variace are homogeeou, the we ue thi t- tet for comparig the mea of the two treatmet. If the Pr> t value i 0.05 or le, the we reject the ull hypothei. Thu, we ca coclude the two treatmet mea are differet. If the variace are ot homogeeou, the we ue thi t-tet for comparig the mea of the two treatmet. e two treatmet mea are differet. Thi F-tet i tetig to ee if the variace of the two treatmet are homogeeou. If the Pr>F value i greater tha 0.00, the we fail to reject the hypothei that the two error variace are homogeeou.
T-tet to compare Treatmet ad (Uequal variace) The TTEST Procedure trt N Mea Std Dev Std Err Miimum Maximum 7 0.943 6.3344.394 3.8000 8.3000 7 6.0857.4758 0.5578 4.000 7.7000 Diff (-) 4.886 4.599.4583 trt Method Mea 95% CL Mea Std Dev 95% CL Std Dev 0.943 5.0559 6.776 6.3344 4.089 3.9488 6.0857 4.708 7.4506.4758 0.950 3.499 Diff (-) Pooled 4.886-0.576 0.848 4.599 3.979 7.598 Diff (-) Satterthwaite 4.886 -.047 0.704 Method Variace DF t Value Pr > t Pooled Equal.96 0.073 Satterthwaite Uequal 6.6495.96 0.094 Equality of Variace Method Num DF De DF F Value Pr > F Folded F 6 6 8.4 0.005
Paired t-tet The TTEST Procedure N Mea Std Dev Std Err Miimum Maximum 5-4.4000.40 0.5099-6.0000-3.0000 Mea 95% CL Mea Std Dev 95% CL Std Dev -4.4000-5.857 -.9843.40 0.683 3.764 DF t Value Pr > t 4-8.63 0.000