Commo Large/Small Sample Tests 1/55
Test of Hypothesis for the Mea (σ Kow) Covert sample result ( x) to a z value Hypothesis Tests for µ Cosider the test H :μ = μ H 1 :μ > μ σ Kow (Assume the populatio is ormal) σ Ukow The decisio rule is: x μ Reject H = > σ if z zα /55
Decisio Rule x μ Reject H if z = > σ zα H : μ = μ H 1 : μ > μ Alterate rule: Reject H if X > μ + Z α σ/ α Z x Do ot reject H μ μ + Reject H z α z α σ Critical value 3/55
Hypothesis Testig Example Test the claim that the true mea # of TV sets i US homes is equal to 3. (Assume σ =.8) 1- State the appropriate ull ad alterative hypotheses H : μ = 3, H 1 : μ 3 (This is a two tailed test) Specify the desired level of sigificace Suppose that α =.5 is chose for this test Choose a sample size Suppose a sample of size = 1 is selected 4/55
Hypothesis Testig Example - Determie the appropriate techique σ is kow so this is a z test Set up the critical values For α =.5 the critical z values are ±1.96 3- Collect the data ad compute the test statistic Suppose the sample results are = 1, x =.84 (σ =.8 is assumed kow) So the test statistic is: X μ.84 3.16 σ.8.8 1 z = = = =. (cotiued) 5/55
Hypothesis Testig Example Is the test statistic i the rejectio regio? (cotiued) 4- Reject H if z < -1.96 or z > 1.96; otherwise do ot reject H α =.5/ Reject H Do ot reject H -z = -1.96 α =.5/ Reject H +z = +1.96 Here, z = -. < -1.96, so the test statistic is i the rejectio regio 6/55
Hypothesis Testig Example Reach a decisio ad iterpret the result (cotiued) α =.5/ α =.5/ Reject H Do ot reject H Reject H -z = -1.96 -. +z = +1.96 Sice z = -. < -1.96, we reject the ull hypothesis ad coclude that there is sufficiet evidece that the mea umber of TVs i US homes is ot equal to 3 7/55
Example: p-value Example: How likely is it to see a sample mea of.84 (or somethig further from the mea, i either directio) if the true mea is µ = 3.? x =.84 is traslated to a z score of z = -. P(z <.) =.8 P(z >.) =.8 α/ =.5.8 α/ =.5.8 p-value =.8 +.8 =.456-1.96 1.96 Z -.. 8/55
Example: p-value Compare the p-value with α If p-value < α, reject H If p-value α, do ot reject H Here: p-value =.456 α =.5 Sice.456 <.5, we reject the ull hypothesis α/ =.5.8-1.96 -. α/ =.5.8 1.96 Z. 9/55
t Test of Hypothesis for the Mea (σ Ukow) Covert sample result ( x ) to a t test statistic Hypothesis Tests for µ σ Kow Cosider the test H :μ = μ H 1 :μ > μ (Assume the populatio is ormal) σ Ukow The decisio rule is: x μ Reject H > s if t = t-1, α 1/55
t Test of Hypothesis for the Mea (σ Ukow) For a two-tailed test: Cosider the test H :μ = μ H :μ 1 μ (Assume the populatio is ormal, ad the populatio variace is ukow) (cotiued) The decisio rule is: x μ x μ Reject H if t = < t or if t = > s s -1, α/ t-1, α/ 11/55
Example: Two-Tail Test (σ Ukow) The average cost of a hotel room i New York is said to be $168 per ight. A radom sample of 5 hotels resulted i x = $17.5 ad s = $15.4 Test at the α =.5 level. (Assume the populatio distributio is ormal) H : μ = 168 H 1 : μ 168 1/55
Example Solutio: Two-Tail Test H : μ = 168 H 1 : μ 168 α/=.5 α/=.5 α =.5 = 5 σ is ukow, so use a t statistic Critical Value: t 4,.5 = ±.639 Reject H -t -1,α/ Do ot reject H Reject H t -1,α/ -.639.639 1.46 x μ s 17.5 168 15.4 t 1 = = = 5 1.46 Do ot reject H : ot sufficiet evidece that true mea cost is differet tha $168 13/55
Tests Cocerig Proportios Sample proportio i the success category is deoted by pˆ ˆ x p = = umber of successes i sample sample size Whe P> 5 ad (1 P) >5 or P (1-P)> 9, ca be approximated by a ormal distributio with mea ad stadard deviatio μ pˆ = P P(1 P) σ pˆ = pˆ 14/55
Hypothesis Tests for Proportios The samplig distributio of pˆ is approximately ormal, so the test statistic is a z value: z = pˆ P P (1 P ) 15/55
Example: Z Test for Proportio A marketig compay claims that it receives 8% resposes from its mailig. To test this claim, a radom sample of 5 were surveyed with 5 resposes. Test at the α =.5 sigificace level. Check: Our approximatio for P is pˆ = 5/5 =.5 P= (5)(.5)> 5 (1-p) > 5 = (5) (.95) > 5 16/55
Z Test for Proportio: Solutio H : P =.8 H 1 : P.8 α =.5 = 5, =.5 Critical Values: ± 1.96 Reject.5 -.47 pˆ -1.96 Reject 1.96.5 z Test Statistic: ˆp P.5.8 = = = P (1 P ).8(1.8) 5 z.47 Decisio: Reject H at α =.5 Coclusio: There is sufficiet evidece to reject the compay s claim of 8% respose rate. 17/55
p-value Solutio Calculate the p-value ad compare to α (For a two sided test the p-value is always two sided) (cotiued) Do ot reject H Reject H Reject H α/ =.5 α/ =.5 p-value =.136:.68.68 P(Z.47) + P(Z.47) = (.68) =.136-1.96 1.96 Z = -.47 Z =.47 Reject H sice p-value =.136 < α =.5 18/55
Hypothesis Tests of oe Populatio Variace Populatio Variace Goal: Test hypotheses about the populatio variace, σ If the populatio is ormally distributed, χ 1 = ( 1)s σ follows a chi-square distributio with ( 1) degrees of freedom 19/45
Cofidece Itervals for the Populatio Variace (cotiued) Populatio Variace The test statistic for hypothesis tests about oe populatio variace is χ 1 = ( 1)s σ /45
Decisio Rules: Variace Populatio variace Lower-tail test: H : σ σ H 1 : σ < σ Upper-tail test: H : σ σ H 1 : σ > σ Two-tail test: H : σ = σ H 1 : σ σ α α α/ α/ χ 1,1 α χ 1, α χ 1,1 α / χ 1, α / Reject H if χ 1 < χ 1,1 α Reject H if χ 1 > χ 1, α Reject H if or χ χ > χ 1 1, α / < χ 1 1,1 α / 1/45
Hypothesis Tests for Two Variaces Tests for Two Populatio Variaces F test statistic Goal: Test hypotheses about two populatio variaces H : σ x σ y H 1 : σ x < σ y H : σ x σ y H 1 : σ x > σ y Lower-tail test Upper-tail test H : σ x = σ y H 1 : σ x σ y Two-tail test The two populatios are assumed to be idepedet ad ormally distributed /45
Hypothesis Tests for Two Variaces Tests for Two Populatio Variaces F test statistic Goal: Test hypotheses about two populatio variaces H : σ x σ y H 1 : σ x < σ y H : σ x σ y H 1 : σ x > σ y Lower-tail test Upper-tail test H : σ x = σ y H 1 : σ x σ y Two-tail test The two populatios are assumed to be idepedet ad ormally distributed 3/45
Test Statistic Tests for Two Populatio Variaces The critical value for a hypothesis test about two populatio variaces is F = x F test statistic s y s where F has ( x 1) umerator degrees of freedom ad ( y 1) deomiator degrees of freedom 4/45
Decisio Rules: Two Variaces Use s x to deote the larger variace. H : σ x σ y H 1 : σ x > σ y α H : σ x = σ y H 1 : σ x σ y α/ Do ot reject H F x 1, y 1,α Reject H F Do ot reject H F x 1, y 1,α / Reject H F Reject H if F > F x 1, y 1,α rejectio regio for a twotail test is: Reject H if F > F x 1, y 1,α / where s x is the larger of the two sample variaces 5/45
Example: F Test You are a fiacial aalyst for a brokerage firm. You wat to compare divided yields betwee stocks listed o the NYSE & NASDAQ. You collect the followig data: NYSE NASDAQ Number 1 5 Mea 3.7.53 Std dev 1.3 1.16 Is there a differece i the variaces betwee the NYSE & NASDAQ at the α =.1 level? 6/45
F Test: Example Solutio Form the hypothesis test: H : σ x = σ y H 1 : σ x σ y (there is o differece betwee variaces) (there is a differece betwee variaces) Fid the F critical values for α =.1/ Degrees of Freedom: Numerator F x 1, 1, α / y (NYSE has the larger stadard deviatio): x 1 = 1 1 = d.f. = F, 4,.1/ =.3 Deomiator: y 1 = 5 1 = 4 d.f. 7/45
F Test: Example Solutio (cotiued) The test statistic is: H : σ x = σ y H 1 : σ x σ y s s 1.3 1.16 F x = = = y 1.56 α/ =.5 F = 1.56 is ot i the rejectio regio, so we do ot reject H Do ot reject H F, 4,.1/ = Reject H.3 F Coclusio: There is ot sufficiet evidece of a differece i variaces at α =.1 8/45
Differece Betwee Two Meas Populatio meas, idepedet samples Goal: Form a cofidece iterval for the differece betwee two populatio meas, μ x μ y Differet data sources Urelated Idepedet Sample selected from oe populatio has o effect o the sample selected from the other populatio 9/45
Hypothesis Tests for Two Populatio Meas Two Populatio Meas, Idepedet Samples Lower-tail test: Upper-tail test: Two-tail test: H : μ x μ y H 1 : μ x < μ y i.e., H : μ x μ y H 1 : μ x μ y < H : μ x μ y H 1 : μ x > μ y i.e., H : μ x μ y H 1 : μ x μ y > H : μ x = μ y H 1 : μ x μ y i.e., H : μ x μ y = H 1 : μ x μ y 3/45
Differece Betwee Two Meas Populatio meas, idepedet samples (cotiued) σ x ad σ y kow Test statistic is a z value σ x ad σ y ukow σ x ad σ y assumed equal Test statistic is a value from the Studet s t distributio 31/45
Populatio meas, idepedet samples σ x ad σ y kow σ x ad σ y Kow * Whe σ x ad σ y are kow ad both populatios are ormal, the variace of X Y is x σ σ = + X Y x σ y y (cotiued) σ x ad σ y ukow ad the radom variable (x y) (μx μ Z = σ σ x y + X Y Y ) has a stadard ormal distributio 3/45
Test Statistic, σ x ad σ y Kow Populatio meas, idepedet samples The test statistic for μ x μ y is: σ x ad σ y kow σ x ad σ y ukow * z = ( x y) σ x x + D σ y y 33/45
Lower-tail test: H : μ x μ y H 1 : μ x μ y < Decisio Rules Two Populatio Meas, Idepedet Samples, Variaces Kow Upper-tail test: H : μ x μ y H 1 : μ x μ y > Two-tail test: H : μ x μ y = H 1 : μ x μ y α α α/ α/ -z α z α -z α/ z α/ Reject H if z < -z α Reject H if z > z α Reject H if z < -z α/ or z > z α/ 34/45
Test Statistic, σ x ad σ y Ukow, Equal Populatio meas, idepedet samples σ x ad σ y kow σ x ad σ y ukow * Assume equal variace ad the the test statistic for μ x μ y is: t = Where t has ( 1 + ) d.f., ad s p ( x y) ( μ μ ) = ( S x p 1)s x 1 x x + ( + y + y x 1 y 1)s y y 35/45
Decisio Rules Two Populatio Meas, Idepedet Samples, Variaces Ukow Lower-tail test: H : μ x μ y H 1 : μ x μ y < Upper-tail test: H : μ x μ y H 1 : μ x μ y > Two-tail test: H : μ x μ y = H 1 : μ x μ y α α α/ α/ -t α t α -t α/ t α/ Reject H if t < -t -1, α Reject H if t > t -1, α Reject H if t < -t -1, α/ or t > t -1, α/ Where t has - 1 d.f. 36/45
Pooled Variace t Test: Example You are a fiacial aalyst for a brokerage firm. Is there a differece i divided yield betwee stocks listed o the NYSE & NASDAQ? You collect the followig data: NYSE NASDAQ Number 1 5 Sample mea 3.7.53 Sample std dev 1.3 1.16 Assumig both populatios are approximately ormal with equal variaces, is there a differece i average yield (α =.5)? 37/45
Calculatig the Test Statistic The test statistic is: t = ( X X ) ( μ μ ) ( 3.7.53) 1 S p 1 1 + 1 1 = 1.51 1 1 + 1 5 =.4 S ( 1) S + ( 1) S ( 1 11.3 ) + ( 5 ) 11.16 (1-1) + (5 1) 1 1 p = = = (1 1) + ( 1) 1.51 38/45
Solutio H : μ 1 - μ = i.e. (μ 1 = μ ) H 1 : μ 1 - μ i.e. (μ 1 μ ) α =.5 df = 1 + 5 - = 44 Critical Values: t = ±.154 Test Statistic: 3.7.53 t = = 1 1 1.51 + 1 5.4 Reject H Reject H.5 -.154.5.154 Decisio: Reject H at α =.5 Coclusio: There is evidece of a differece i meas. t.4 39/45
Two-Sample Tests i EXCEL For paired samples (t test): Tools data aalysis t-test: paired two sample for meas For idepedet samples: Idepedet sample Z test with variaces kow: Tools data aalysis z-test: two sample for meas Idepedet sample Z test with variaces kow: Tools data aalysis z-test: two sample assumig equal variaces For variaces F test for two variaces: Tools data aalysis F-test: two sample for variaces