Sunteți pe pagina 1din 5

10/3/2016

7.1IntroductiontoHypothesisTesting|STAT500

STAT500
AppliedStatistics

7.1IntroductiontoHypothesisTesting
Printerfriendlyversion (https://onlinecourses.science.psu.edu/stat500/print/book/export/html/39)
UnitSummary
HypothesisTesting
HypothesesandTestStatistics
TheNullandAlternativeHypothesis
ChoosingtheNullandAlternativeHypotheses
TheLogicofHypothesisTesting

ReadingAssignment
AnIntroductiontoStatisticalMethodsandDataAnalysis,(SeeCourseSchedule).

HypothesisTesting
Thesecondtypeofinferencemethodconfidenceintervalswasthefirst,ishypothesistesting.Ahypothesis,in
statistics,isastatementaboutapopulationwherethisstatementtypicallyisrepresentedbysomespecific
numericalvalue.Intestingahypothesis,weuseamethodwherewegatherdatainanefforttogatherevidence
aboutthehypothesis.Inhypothesistestingtherearecertainstepsonemustfollow.Belowtheseare
summarizedintosixsuchstepstoconductingatestofahypothesis.
1.SettinguptwocompetinghypothesesEachhypothesistestincludestwohypothesisaboutthe
population.Oneisthenullhypothesis,notatedasHo,whichisastatementofaparticularparameter
value.Thishypothesisisassumedtobetrueuntilthereisevidencetosuggestotherwise.Thesecond
hypothesisiscalledthealternative,orresearch,hypothesis,notatedasHa .Thealternativehypothesisisa
statementofarangeofalternativevaluesinwhichtheparametermayfall.Onemustalsocheckthatany
assumptions(conditions)neededtorunthetesthavebeensatisfiede.g.normalityofdata,independence,
andnumberofsuccessandfailureoutcomes.
2.Setsomelevelofsignificancecalledalpha.Thisvalueisusedasaprobabilitycutoffformaking
decisionsaboutthenullhypothesis.Aswewilllearnlater,thisalphavaluerepresentstheprobabilitywe

https://onlinecourses.science.psu.edu/stat500/node/39

1/5

10/3/2016

7.1IntroductiontoHypothesisTesting|STAT500

arewillingtoplaceonourtestformakinganincorrectdecisioninregardstorejectingthenullhypothesis.
Themostcommonalphavalueis0.05or5%.Otherpopularchoicesare0.01(1%)and0.1(10%).
3.Calculateateststatistic.Gathersampledataandcalculateateststatisticwherethesamplestatisticis
comparedtotheparametervalue.Theteststatisticiscalculatedundertheassumptionthenullhypothesis
istrue,andincorporatesameasureofstandarderrorandassumptions(conditions)relatedtothesampling
distribution.Suchassumptionscouldbenormalityofdata,independence,andnumberofsuccessand
failureoutcomes.
4.Calculateprobabilityvalue(pvalue),orfindrejectionregionApvalueisfoundbyusingthetest
statistictocalculatetheprobabilityofthesampledataproducingsuchateststatisticoronemoreextreme.
Therejectionregionisfoundbyusingalphatofindacriticalvaluetherejectionregionistheareathatis
moreextremethanthecriticalvalue.
5.MakeatestdecisionaboutthenullhypothesisInthisstepwedecidetoeitherrejectthenull
hypothesisordecidetofailtorejectthenullhypothesis.Noticewedonotmakeadecisionwherewewill
acceptthenullhypothesis.
6.StateanoverallconclusionOncewehavefoundthepvalueorrejectionregion,andmadeastatistical
decisionaboutthenullhypothesis(i.e.wewillrejectthenullorfailtorejectthenull).Followingthis
decision,wewanttosummarizeourresultsintoanoverallconclusionforourtest.

HypothesesandTestStatistics
Wewillcontinueourdiscussionbyconsideringtwospecifichypothesistests:atestofoneproportion,andatest
ofonemean.Wewillprovidethegeneralsetupofthehypothesisandtheteststatisticsforbothtests.From
there,wewillbranchoffintospecificdiscussionsoneachofthesetests.
Inordertomakejudgmentaboutthevalueofaparameter,theproblemcanbesetupasahypothesistesting
problem.

TheNullandAlternativeHypothesis
Weusuallysetthehypothesisthatonewantstoconcludeasthealternativehypothesis,alsocalledtheresearch
hypothesis.
Therearethreetypesofalternativehypotheses:
1.Thepopulationparameterisnotequaltoacertainvalue.Referredtoasa"twosidedtest".
2.Thepopulationparameterislessthanacertainvalue.Referredtoasa"lefttailedtest"
3.Thepopulationparameterisgreaterthanacertainvalue.Referredtoasa"righttailedtest".
Forallthreealternatives,thenullhypothesisisthepopulationparameterisequaltothatcertainvalue.
Sincehypothesistestsareaboutaparametervalue,thehypothesesuseparameternotationpforproportionor
formeanintheirarrangement.Fortestsofaproportionoratestofamean,wewouldchoosethe
appropriatealternativebasedonourresearchquestion.Belowarethepossiblealternativehypothesisfrom
whichwewouldselectonlyoneofthembasedontheresearchquestion.Thesymbolsp and arejustused
0

https://onlinecourses.science.psu.edu/stat500/node/39

2/5

10/3/2016

7.1IntroductiontoHypothesisTesting|STAT500

inthesegeneralstatements.Inpractice,thesegetreplacedbytheparametervaluebeingtested.Theexamples
followingwillillustrate.
1.Thepopulationparameterisnotequaltoacertainvalue.Referredtoasa"twotailedtest".
Ha : p p 0

,orH

: 0

2.Thepopulationparameterislessthanacertainvalue.Referredtoasa"lefttailedtest"
Ha : p < p 0

,orH

: < 0

3.Thepopulationparameterisgreaterthanacertainvalue.Referredtoasa"righttailedtest".
Ha : p > p 0

,orH

: > 0

Thenullhypothesisineachcasewouldbe:
H0 : p = p 0

,orH

: = 0

WhendebatingtheStateAppropriationforPennState,thefollowingquestionisasked:"Arethe
majorityofstudentsatPennStatefromPennsylvania?"Toanswerthisquestion,wecansetitupasahypothesis
testingproblemandusedatacollectedtoanswerit.Thisexampleisaboutapopulationproportionandthuswe
setupthehypothesesintermsofp.Herethevaluep is0.5sincemorethan0.5constituteamajority.The
hypthosessetupwouldbearighttailedtest:
0

vs.H

H0 : p = 0.5

: p > 0.5

Aconsumertestagencywantstoseethewhetherthemeanlifetimeofabrandoftiresislessthan
42,000milesasthetiremanufactureradvertisesthattheaveragelifetimeisatleast42,000miles.Inthis
example,wearediscussingameanandthereforesetupthehypothesesintermsof.Herethevalueof is
42,000.Withtheconsumertestagencywantingtoresearchthatthemeanlifetimeisbelow42,000,wewould
setupthehypothesesasalefttailedtest:
0

H0 : = 42, 000

vs.H

: < 42, 000

Thelengthofacertainlumberfromanationalhomebuildingstoreissupposedtobe8.5feet.A
builderwantstocheckwhethertheshipmentoflumbershereceiveshasameanlengthdifferentfrom8.5feet.
Inthisexample,wearediscussingameanandthereforesetupthehypothesesintermsof.Herethevalueof
is8.5.Withthebuilderwantingtocheckifthemeanlengthisdifferentfrom8.5,shewouldsetupthe
hypothesesasatwotailedtest:
0

H0 : = 8.5

vs.H

: 8.5

https://onlinecourses.science.psu.edu/stat500/node/39

3/5

10/3/2016

7.1IntroductiontoHypothesisTesting|STAT500

Apoliticalnewscompanybelievesthenationalapprovalratingforthecurrentpresidenthasfallen
below40%.Inthisexample,wearediscussingaproportionandthereforewillsetupthehypothesisintermsof
p.Hereisthep valueis0.4andthehypotheseswouldbesetupasalefttailedtest:
0

vs.H

H0 : p = 0.4

: p < 0.4

ChoosingtheNullandAlternativeHypothesis
Iftheconditionsnecessarytoconductthehypothesistestaresatistified,thenwecanusetheformulasbelowto
calculatetheappropriateteststatisticfromoursampledata.Theseassumptionsandteststatisticsareasfollows:
TestofOneProportion:theconditionsarethatnp andn(1 p )areatleast5.Ifso,thentheoneproportion
teststatisticis:
0

^ p0
p

p (1p )
0

TestofOneMean:theconditionisthatthedatasatisfiestheconditionssimilartothoseusedforconstructinga
tconfidenceintervalforthemean.Thosewereeitherthedatacomesfromanapproxmatelynormal
distribution,orthesamplesizeislargeenough(atleast30),orasmallsamplesize(lessthan30)thedataisnot
skewedorhasoutliers.Ifanyoftheseconditionsaresatisfied,thewecancalculatethefollowingteststatistic:
t

0
x
S/n

NOTEdonotgettoohunguponsymbols.Wejustwanttouseanotationthathelpstoremindusthatthese
valuesareateststatstic.

TheLogicofHypothesisTesting
Howdowedecidewhethertorejectthenullhypothesis?
Ifthesampledataareconsistentwiththenullhypothesis,thenwedonotrejectit.
Ifthesampledataareinconsistentwiththenullhypothesis,butconsistentwiththealternative,thenwe
rejectthenullhypothesisandconcludethatthealternativehypothesisistrue.

Referringbacktothefirstexampleabove,saywetakearandomsampleof500PennStatestudents
andfindthat278arefromPennsylvania.Canweconcludethattheproportionislargerthan0.5?
Is278/500=0.556muchbiggerthan0.5?Whatismuchbigger?Thisdependsonthestandarddeviationofp^
underthenullhypothesis.
^ p
p

= 0.556 0.5 = 0.056

Thestandarddeviationofp^ ,ifthenullhypothesesistrue(e.g.whenp
https://onlinecourses.science.psu.edu/stat500/node/39

)is:

= 0.5

4/5

10/3/2016

7.1IntroductiontoHypothesisTesting|STAT500

p0 (1 p0 )

0.5 (1 0.5)

0.5 (1 0.5)

500

Wecancomparethembytakingtheratio.
Z

^ p0
p

0.556 0.5

p (1p )
0

= 2.504

0.5(10.5)
n

Inthelumberexampleabove,themeanlengthofthelumberissupposedtobe8.5feet.Abuilder
wantstocheckwhethertheshipmentoflumbershereceiveshasameanlengthdifferentfrom8.5feet.Ifthe
builderobservesthatthesamplemeanof61piecesoflumberis8.3feetwithasamplestandarddeviationof1.2
feet.Whatwillsheconclude?

Is8.3verydifferentfrom8.5?ThisdependsonthestandarddeviationofX
:

0
x
S/n

8.3 8.5
=

1.2/61

= 1.3

Thus,weareaskingif1.3isveryfarawayfromzero,sincethatcorrespondstothecasewhenX
isequalto
.Ifitisfaraway,thenitisunlikelythatthenullhypothesisistrueandonerejectsit.Otherwise,onecannot
rejectthenullhypothesis.
0

Howdowedeterminewhethertorejectthenullhypothesis?Itdependsonthelevelofsignificance (step2of
conductingahypothesistest),andtheprobabilitythesampledatawouldproducetheobservedresult.
Lesson7HypothesisTesting (/stat500/node/38)

up

7.2Terminologies,TypeIandTypeII

(/stat500/node/38)ErrorsforHypothesisTesting(/stat500/node/40)

https://onlinecourses.science.psu.edu/stat500/node/39

5/5

S-ar putea să vă placă și