Section 11.1 Notes COMPLETE

Section 11.1 Notes - Complete
Take your bag of M&Ms and the complete the table below showing the frequency of
the colors and how they were distributed .
Observed
Counts
The M&M website advertises that plain M&M colors SHOULD be distributed
by the following percentages.
Expected
Rel.Freq.
IfyouassumethatthenumberofM&Msinyour
bagdoesnotchange,howmanyofeachcolor
wouldyouhaveEXPECTEDtoGind,basedon
M&Msclaim?Pleasedonotroundtoomuch...
Expected
Counts
Section 11.1 Notes - Complete
Ultimatelywewouldliketodetermineifthe
differencesweseebetweentheobservedcounts
ofcolorsandtheexpectedcountsofcolors
(assumingM&M'sclaimistrue)aresigniGicant.
Wecoulddothisbyrunning6differentoneproportionz-testsbut...
Performingone-proportionztestsforeachcolorwouldn’ttellus
howlikelyitistogetarandomsampleofthesamenumber
candieswithacolordistributionthatdiffersasmuch(ormore)
fromtheoneclaimedbythecompanyasthisbagdoes(takingall
thecolorsintoconsiderationatonetime).
Forthat,weneedanewkindofsigniGicancetest,calleda
chi-squaregoodness-of-1ittest.
Theideaofthechi-squaregoodness-of-Gittestisthis:wecompare
theobservedcountsfromoursamplewiththecountsthat
wouldbeexpectedifH0istrue.Themoretheobservedcounts
differfromtheexpectedcounts,themoreevidencewehave
againstthenullhypothesis.
Section 11.1 Notes - Complete
Hypotheses:
Thenullhypothesisinachi-squaregoodness-of-Gittestshouldstate
aclaimaboutthedistributionofasinglecategoricalvariableinthe
populationofinterest.Inourexample,theappropriatenull
hypothesisis:
Thealternativehypothesisinachi-squaregoodness-of-Gittest
isthatthecategoricalvariabledoesnothavethespeciGied
distribution.Inourexample,thealternativehypothesisis
TestStatistic
De1inition:
Thechi-squarestatisticisameasureofhowfartheobserved
countsarefromtheexpectedcounts.Theformulaforthe
statisticis
wherethesumisoverallpossiblevaluesofthecategorical
variable.
Section 11.1 Notes - Complete
CalculatetheX2statisticbycopyingyourobservedandexpectedcounts
hereanddeterminingtheX2contributionforeachvalueofthevariable
color.
Observed
Counts
Expected
Counts
Chi-Square
Contribution
ThinkofX2asameasureofthedistanceofthe
observedcountsfromtheexpectedcounts.
LargevaluesofX2arestrongerevidenceagainst
H0becausetheysaythattheobservedcounts
arefarfromwhatwewouldexpectifH0were
true.
SmallvaluesofX2suggestthatthedataare
consistentwiththenullhypothesis.
Section 11.1 Notes - Complete
P-Value
Inordertocalculatethep-valueweneedtounderstandtheX2
Distribution.
Thesamplingdistributionofthechi-squarestatisticisNOTaNormal
distribution.
Thechi-squaredistributionsareafamilyofdistributionsthattakeonly
positivevaluesandareskewedtotheright.Aparticularchi-square
distributionisspeciGiedbygivingitsdegreesoffreedom.Thechi-square
goodness-of-Gittestusesthechi-squaredistributionwithdegreesof
freedom=thenumberofcategories-1.
Findingthep-valueusingTableC:
• Locatethecorrectrowusingthedegreesof
freedom
• ReadacrosstherowtoGindapairofX2values
thatcreateanintervalthatcontainsYOURX2
teststatistic
• Looktothetopoftheserowstoreadoftwotail
probabilities
• Yourp-valueliesbetweenthesetwo
probabilities.
Findyourp-valuefromtheM&Mexampleusing
TableC.
Section 11.1 Notes - Complete
Findingthep-valueusingyourcalculator:
• Gotothedistributionmenu
• SelectX2cdf(thisshouldseemfamiliar...)
• Lower:yourX2teststatistic
• Upper:10^99
• df:numberofcategories-1
Findyourp-valuefromtheM&Mexampleusing
yourcalculator.
Conditions
Random:datacamefromarandomsample,randomized
experiment,orrandomphenomenon
LargeSampleSize:Thesamplesizemustbelargeenoughso
thatALLEXPECTEDcountsaregreaterthanorequalto5.
Independent:Individualsshouldbeindependent.Ifsampling
withoutreplacement,checkthe10%condition.
Section 11.1 Notes - Complete
Thingstokeepinmind...
1.Thechi-squareteststatisticcomparesobservedandexpected
counts.Don’ttrytoperformcalculationswiththeobservedand
expectedproportionsineachcategory.
2.WhencheckingtheLargeSampleSizecondition,besureto
examinetheexpectedcounts,nottheobservedcounts.
Arebirthsevenlydistributedacrossthedaysoftheweek?Theonewaytablebelowshowsthedistributionofbirthsacrossthedaysof
theweekinarandomsampleof140birthsfromlocalrecordsina
largecity.DothesedatagivesigniGicantevidencethatlocalbirths
arenotequallylikelyonalldaysoftheweek?
Section 11.1 Notes - Complete
Section11.1Homework:
p.692#s1,3,5,7,9,11,17