资源描述:
《the r book count data》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、14CountDataUptothispoint,theresponsevariableshaveallbeencontinuousmeasurementssuchasweights,heights,lengths,temperaturesandgrowthrates.Agreatdealofthedatacollectedbyscientists,medicalstatisticiansandeconomists,however,isintheformofcounts(wholenumbersorintegers).Thenumberof
2、individualswhodied,thenumberoffirmsgoingbankrupt,thenumberofdaysoffrost,thenumberofredbloodcellsonamicroscopeslide,andthenumberofcratersinasectoroflunarlandscapeareallpotentiallyinterestingvariablesforstudy.Withcountdata,thenumber0oftenappearsasavalueoftheresponsevariable(c
3、onsider,forexample,whata0wouldmeaninthecontextoftheexamplesjustlisted).Inthischapterwedealwithdataonfrequencies,wherewecounthowmanytimessomethinghappened,butwehavenowayofknowinghowoftenitdidnothappen(e.g.lightningstrikes,bankruptcies,deaths,births).Thisisincontrasttocountd
4、ataonproportions,whereweknowthenumberdoingaparticularthing,butalsothenumbernotdoingthatthing(e.g.theproportiondying,sexratiosatbirth,proportionsofdifferentgroupsrespondingtoaquestionnaire).Straightforwardlinearregressionmethods(assumingconstantvariance,normalerrors)arenota
5、ppropriateforcountdataforfourmainreasons:Thelinearmodelmightleadtothepredictionofnegativecounts.Thevarianceoftheresponsevariableislikelytoincreasewiththemean.Theerrorswillnotbenormallydistributed.Zerosaredifficulttohandleintransformations.InR,countdataarehandledveryeleg
6、antlyinageneralizedlinearmodelbyspecifyingfamily=poissonwhichsetserrors=Poissonandlink=log(seep.558).Theloglinkensuresthatallthefittedvaluesarepositive,whilethePoissonerrorstakeaccountofthefactthatthedataareintegerandhavevariancesthatareequaltotheirmeans.14.1Aregressionwith
7、PoissonerrorsThefollowingexamplehasacount(thenumberofreportedcancercasesperyearperclinic)astheresponsevariable,andasinglecontinuousexplanatoryvariable(thedistancefromanuclearplanttotheclinicinkilometres).Thequestioniswhetherornotproximitytothereactoraffectsthenumberofcance
8、rcases.TheRBook,SecondEdition.MichaelJ.Crawley.©2013JohnWiley&Sons,Ltd.Published2013byJoh