Anda di halaman 1dari 38

Testofhypothesis Test of hypothesis

Objectivesofthetopic: K Knowhypothesistestsforasinglesampleandtwo h th i t t f i l l dt samples. g yp g g Integratehypothesistestswithindustrialengineering decisions.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Introductiontohypotheses
Astatisticalhypothesisisastatementabouttheparametersof oneormorepopulations. Thehypothesiswhetherornotthemeanofthepopulationis 0 isstatedas H0 :=0 H1 :0 H0 iscalledthenullhypothesisandH1 thealternative hypothesis. Thistypeofhypothesesiscalledtwosidedalternative.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Onesidedalternativecanbestatedas H0 :=0 H1 :<0 or H0 :=0 H1 :>0

Hypothesistestingproceduresrelyonusingtheinformation inarandomsamplefromthepopulationofinterest. Testingthehypothesisinvolvestakingarandomsample, computingateststatisticfromthesampledata,andthen usingtheteststatistictomakeadecisionaboutthenull using the test statistic to make a decision about the null hypothesis.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TypeIerrorisdefinedasrejectingthenullhypothesisH0 whenitistrue. TypeIIerrorisdefinedasfailingtorejectthenullhypothesis whenitisfalse. The probability of type I error is given by TheprobabilityoftypeIerrorisgivenby =P(typeIerror) TheprobabilityoftypeIIerrorisgivenby =P(typeIIerror)
Decision Fail torejectH0 RejectH0 H0 istrue Noerror TypeIerror H0 isfalse TypeIIerror Noerror

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Thepowerofastatisticaltestistheprobabilityofrejecting thenullhypothesisH0 whenthealternativehypothesisistrue. Thepowerisequalto1. ThePvalueisthesmallestlevelofsignificancethatwould leadtorejectionofthenullhypothesiswiththegivendata. lead to rejection of the null hypothesis with the given data

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Practice
Inaliquidfillingoperation,thetargetfillingvolumeis50ml. Ifwewanttotestwhetherthefillingoperationisactually producing50ml,wecanevaluatethehypothesis d i 50 l l t th h th i H0 :=50 H1 :50 Here,isthepopulationmeanortheactualfillingvolumeof theprocess. the process Theunbiasedestimatorofthepopulationmeanisthesample average. AssumethatwewillrejectH0 ifthesampleaveragefalls below48.5orabove51.5.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Assumethesamplesizen=10andstandarddeviation =2.5. Then,theprobabilityoftypeIerroris


= P{ X < 48.5 when = 50} + P{ X > 51.5 when = 50} 48.5 50 51.5 50 = P Z < + P Z > 2.5 / 10 2.5 / 10 = P{Z < 1.90}+ P{Z > 1.90} = 0.0574

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Assumenowthatthemeanfillingvolumeisnot50,but52ml. Then,theprobabilityoftypeIIerroris
= P{48.5 X 51.5when = 52} 51.5 52 48.5 52 = P Z 2.5 / 10 2.5 / 10 = P{ 4.43 Z 0.63} 3 = 0.2643

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Testsofthemeanofanormaldistribution, varianceknown
Inthecaseofthehypothesistestonthemeanofanormal population,weusetheteststatistic
Z0 = X 0 / n

For the t o sided alternati e H0 sho ld be rejected if Forthetwosidedalternative,H shouldberejectedif z0 >z/2 or z0 < z/2 Fortheonesidedalternative,H0 shouldberejectedif z0 >z forH1 :>0 z0 < z forH1 :<0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

ThePvalueiscomputedasfollows
2[1 (| z0 |)] if H1 : = 0 P = 1 (| z0 |) if H1 : > 0 (| z |) if H1 : < 0 0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

,samplesize,andOCcurves
Supposeforatwosidedalternativehypothesis,H0 isfalseand thetruemean =0 +. Wecanwritetheteststatistic
Z0 = X 0 X ( 0 + ) = + / n / n / n

byaddingandsubtractingaconstantterm Since the mean of the first term is zero then the distribution Sincethemeanofthefirsttermiszero,thenthedistribution ofZ0 whenH1 istrueis
Z0 ~ N ,0 / n

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TypeIIerrorwillbecommittedwhenz/2 Z0 z/2. Therefore,theprobabilityoftypeIIerroriscomputedas


= z / 2 z / 2 / n / n

Thevalueof dependsonthesamplesize,thestandard deviation,andthedeviation. The operating characteristic curves make it easy to compute Theoperatingcharacteristiccurvesmakeiteasytocompute thevalueof. TheOCcurvesplot versusthenormalizeddeviationfor varioussamplesizes. Thenormalizeddeviationiscomputedasd=||/. The OC curves can be also used to find the required sample TheOCcurvescanbealsousedtofindtherequiredsample sizeforagiven andd.
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Testsofthemeanofanormaldistribution, varianceunknown
Theteststatisticforthehypothesistestonthemeanofa normalpopulationwithunknownvarianceis X 0 T0 = S/ n For the t o sided alternati e H0 sho ld be rejected if Forthetwosidedalternative,H shouldberejectedif t0 >t/2,n1 or t0 < t/2,n1 Fortheonesidedalternative,H0 shouldberejectedif t0 >t,n1 forH1 :>0 ,n 1 t0 < t,n1 forH1 :<0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Testsonthevarianceofanormaldistribution
Thehypothesisonthepopulationvarianceisstatedas H0 :2 =02 Theteststatisticforhypothesistestsonthevarianceis (n 1) S 2 2 0 = 2 0 Fortwosidedalternative,H0 shouldberejectedif 2 2 2 2 0 > / 2,n 1 or 0 < 1- / 2,n 1 H0 shouldberejectedforonesidedalternativesif 2 2 2 0 > ,n 1 for H1 : 2 > 0
2 2 0 < 1- ,n 1

for

2 H1 : 2 < 0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

,samplesize,andOCcurves
Theoperatingcharacteristiccurvesforthehypothesisonthe populationvarianceareprovided. ThexaxisontheOCcurvesistheratioofthetruestandard deviationoverthehypothesizedstandarddeviation:
= 0

isthetruestandarddeviationand0 isthehypothesizeds.d. yp

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Testsonapopulationproportion
Whenthepopulationisdividedintotwodissimilargroups,the numberofelementsinonegrouprelativetothepopulationis callproportion. ll ti Proportionsfollowreasonablythebinomialdistribution. The hypothesis of interest is Thehypothesisofinterestis H0 :p=p0 H1 :pp0 When the sample satisfies the conditions that np0 5 and Whenthesamplesatisfiestheconditionsthatnp 5and n(1p0) 5, thenormaldistributionapproximatesthe binomialdistribution.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Theteststatisticbasedonthenormalapproximationis P p0 Z0 = p0 (1 p0 ) / n
P whereisthesampleproportion. Fortwosidedalternative,H0 isrejectedif z0 > z/2 >z or or z0 < z/2 <

In case of onesided alternative, H0 should be rejected if Incaseofone sidedalternative,H shouldberejectedif z0 >z forH1 :p>p0 z0 < z forH1 :p<p0
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Practice
Acompressedtamor packagingplanthasdeterminedthat leakageinpackscanhappenandcustomerswouldtoleratea fractionofleakingcompresseddatespacksnotexceeding5%. f ti f l ki dd t k t di 5% Toassessthecapabilityoftheplantinmeetingthecustomers requirement,theindustrialengineerhastotestthe q , g hypothesisthatthefractionofbaddatesislessthan5%: H0 :p=0.05 H1 :p<0.05 Hecollectedarandomsampleof200datespacksandfound4 leakingpacks.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Checktherequirements:2000.05=10,2000.95=190.The normalapproximationisadequate. Thevalueoftheteststatisticis

z0 =

4 200

0.05

0.05(1 0.05) / 200

= 1.95

From the z tables z0 05 =1 645 Fromtheztables,z0.05 1.645. Since1.645>1.95,werejectH0 andconcludethatthe fractionofleakingpacksislessthan0.05.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

andthechoiceofthesamplesize
Beforenormalization,thelimitsoftheacceptanceregionare

p0 z / 2 p0 (1 p0 ) / n

and

p0 + z / 2 p0 (1 p0 ) / n

Whenthetrueproportionisp p0,thenthenormalizedlimits oftheacceptanceregionare

p0 z / 2 p0 (1 p0 ) / n p p (1 p ) / n

and

p0 + z / 2 p0 (1 p0 ) / n p p (1 p) / n

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TheprobabilityoftypeIIerrorisgivenbytheareaunderthe normalcurveinsidetheacceptanceregion:

p0 + z / 2 p0 (1 p0 ) / n p p0 z / 2 p0 (1 p0 ) / n p = p (1 p) / n p (1 p ) / n
ForH1:p<p0,theprobabilityis p0 z p0 (1 p0 ) / n p = 1 p (1 p ) / n ForH1:p>p0,theprobabilityis p0 + z p0 (1 p0 ) / n p = p(1 p) / n
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Theapproximatesamplesizerequiredforagiven inatwo sidedalternativehypothesisis

z / 2 p0 (1 p0 ) z p(1 p) n= p p0
andforonesidedalternative

z p0 (1 p0 ) z p(1 p) n= p p0

Notethattheareaunderthestandardnormalcurvetothe leftofz is. f f


DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Practice
Inthecompresseddatespackagingoperation,theindustrial engineerwouldliketodesignahypothesisontheproportion ofleakingpacksthatwilldetectashiftintheproportionof f l ki k th t ill d t t hift i th ti f 0.03byaprobabilityof0.9. So,theprobabilityoftypeIIerrorhastobe0.1. , p y yp Usingthepreviousonesidedalternativehypothesis,z0.05 = 1.64andz0.1 =1.28. Therequiredsamplesizeis
1.64 0.05(1 0.05) (1.28) 0.03(1 0.03) n= = 832 0.03 0.05
2

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Inferenceconcerningtwomeans,variancesknown
Itisassumedthetwopopulationsareindependentand normal. Thehypothesisconcerningthedifferenceonthemeansof twopopulationsis: H0: 1 2 = 0 : = Theteststatisticforthishypothesisis

Z0 =

X1 X 2 0
2 1 2 + 2 n1 n2

Fortwosidedalternative,H0 isrejectedif z0 >z/2 or z0 < z/2


DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Fortheonesidedalternative,H0 shouldberejectedif z0 >z forH1 :1 2 >0 z0 < z forH1 :1 2 <0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TypeIIerrorandsamplesize
TheOCcurvesforthesinglepopulationmeancanbeusedon thecaseoftwopopulationmeans,wherethepointonthe horizontallineisdefinedas h i t l li i d fi d
d= 0
2 12 + 2

isthetruedifferenceinmeansand0 isthehypothesized yp difference.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Inferenceconcerningtwomeans,variancesunknown
Ifthevariancesofthetwopopulationsareknowntobeequal, thepooledestimatorofthecommonvarianceisused:
2 (n1 1) S12 + (n2 1) S 2 S = n1 + n2 2 2 p

Theteststatisticis
X1 X 2 0 T0 = 1 1 + Sp n1 n2

whichhasatdistributionwithn1+n22degreesoffreedom.
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Forthetwosidedalternative,H0 shouldberejectedif

t0 > t / 2,n1 + n2 2 or
t0 > t ,n1 + n2 2

t0 < t / 2,n1 + n2 2

Fortheonesidedalternative,H0 shouldberejectedif

for H 0 : 1 2 > 0

t0 < t ,n1 + n2 2 for H 0 : 1 2 < 0

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Whenthetwovariancesarenotequal,theirestimatesare usedincomputingthevalueoftheteststatistic. Theteststatisticis X1 X 2 0 T0 = 2 S12 S 2 + n1 n2 whichhasatdistributionwith degreesoffreedomequalto which has a t distribution with degrees of freedom equal to 2 2 2 s1 s2 + n n = 2 12 2 2 ( s1 / n1 ) ( s2 / n2 ) 2 + n1 1 n2 1 roundedtothenearestinteger.
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

andsamplesize
TheOCcurvesareavailableonlyforthecasewherethetwo variancesareequal. Thepointonthehorizontallineisdefinedas
d= 0 2

Ifthestandarddeviationisnotknown,thepooleds.d.Sp can beusedasanestimateof. Thesamplesizen*fromtheOCcurvesisthetotalsamplesize forbothpopulation,hencethetotalsamplesizehastobe dividedequallyamongthetwopopulations: di id d ll th t l ti


n* + 1 n1 = n2 = 2
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Hypothesistestsontheratiooftwovariances
Thehypothesisofconcernis: H0:12 =22 Theteststatisticis F0 =S12/S22 Thenullhypothesisisrejectedinfollowingalternativecases:
2 2 f 0 > f / 2,n1 1,n2 1 or f 0 < f1- / 2,n1 1,n2 1 for H1 : 1 1

f 0 > f ,n1 1,n2 1 f 0 < f1- ,n1 1,n2 1

2 2 for H1 : 1 > 1 2 2 for H1 : 1 < 1

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TypeIIerrorandsamplesize
Theoperatingcharacteristiccurvesrelatethesamplesize, probabilityoftypeIIerror,andthetwostandarddeviations ratio: ti
= 1 2

wheren1 =n2 =nfromtheOCcurves.

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Hypothesisontwopopulationproportions
Thehypothesisontheequalityoftwopopulationproportions is H0:p1 p2 =0 For s fficientl large samples the mean difference in Forsufficientlylargesamples,themeandifferencein p1 p2 proportionsisnormallydistributedwithmeanand variance p1 (1 p1 ) + p2 (1 p2 ) . n1 n2

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Thestatistic
P P2 ( p1 p2 ) 1 Z= p1 (1 p1 ) p2 (1 p2 ) + n1 n2 isnormallydistributedwithmean0andvariance1,where P and P2 arethesampleproportions. 1 For the hypothesis on the equality of the two proportions the Forthehypothesisontheequalityofthetwoproportions,the teststatisticis p1 p2 Z0 = p1 (1 p1 ) p2 (1 p2 ) + n1 n2

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Fortwosidedalternative,H0 isrejectedif or z0 < z/2 z0 >z/2 Incaseofonesidedalternative,H0 shouldberejectedif z0 >z forH1 :p1 >p2 z0 < z forH1 :p1 <p2

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

TypeIIerrorandsamplesize
Thelimitsoftheconfidenceintervalontheproportions differenceare
P (1 P ) P2 (1 P2 ) 1 1 P z P + 1 2 /2 n1 n2 and P (1 P ) P2 (1 P2 ) 1 1 P +z P + 1 2 /2 n1 n2

DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Ifthetrueproportionsdifferenceisp1 p2,theprobabilityof typeIIerroris


p (1 p1 ) p2 (1 p2 ) p1 p2 + z / 2 1 + ( p1 p2 ) n1 n2 = p1 (1 p1 ) p2 (1 p2 ) + n1 n2 p (1 p1 ) p2 (1 p2 ) p1 p2 z / 2 1 + ( p1 p2 ) n1 n2 p1 (1 p1 ) p2 (1 p2 ) + n1 n2
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

ForonesidedalternativeH1 :p1 >p2 ,theprobabilityis


p1 (1 p1 ) p2 (1 p2 ) p1 p2 + z + ( p1 p2 ) n1 n2 = p1 (1 p1 ) p2 (1 p2 ) + n1 n2

For H1 : p1 < p2 ,theprobabilityis ForH :p <p the probability is


p1 (1 p1 ) p2 (1 p2 ) p1 p2 z + ( p1 p2 ) n1 n2 = 1 p1 (1 p1 ) p2 (1 p2 ) + n1 n2
DrMuhammadAlSalamah,IndustrialEngineering,KFUPM

Anda mungkin juga menyukai