资源描述:
《the r book proportion data》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、16ProportionDataAnimportantclassofproblemsinvolvescountdataonproportionssuchas:studiesondeathrates,infectionratesofdiseases,answerstoquestionnaires,proportionrespondingtoclinicaltreatment,proportionadmittingtoparticularvotingintentions,sexratios,ordataonproportionalresp
2、onsetoanexperimentaltreatment.Whatallthesehaveincommonisthatweknowhowmanyoftheexperimentalobjectsareinonecategory(dead,insolvent,maleorinfected)andwealsoknowhowmanyareinanother(alive,solvent,femaleoruninfected).ThiscontrastswithPoissoncountdata,whereweknewhowmanytimesaneventoc
3、curred,butnothowmanytimesitdidnotoccur(p.579).WemodelprocessesinvolvingproportionalresponsevariablesinRbyspecifyingageneralizedlinearmodelwithfamily=binomial.TheonlycomplicationisthatwhereaswithPoissonerrorswecouldsimplyspecifyfamily=poisson,withbinomialerrorswemustgivethenumb
4、eroffailuresaswellasthenumbersofsuccessesinatwo-vectorresponsevariable.Todothiswebindtogethertwovectorsusingcbindintoasingleobject,y,comprisingthenumbersofsuccessesandthenumberoffailures.Thebinomialdenominator,n,isthetotalsample,andnumber.of.failures<-binomial.denominator-numb
5、er.of.successesy<-cbind(number.of.successes,number.of.failures)Theoldfashionedwayofmodellingthissortofdatawastousethepercentagemortalityastheresponsevariable.Therearefourproblemswiththis:Theerrorsarenotnormallydistributed.Thevarianceisnotconstant.TheRBook,SecondEdition.Micha
6、elJ.Crawley.©2013JohnWiley&Sons,Ltd.Published2013byJohnWiley&Sons,Ltd.PROPORTIONDATA629Theresponseisbounded(by1aboveandby0below).Bycalculatingthepercentage,weloseinformationonthesizeofthesample,n,fromwhichtheproportionwasestimated.Rcarriesoutweightedregression,usingtheindivi
7、dualsamplesizesasweights,andthelogitlinkfunctiontoensurelinearity.Therearesomekindsofproportiondata,suchaspercentagecover,whicharebestanalysedusingconventionallinearmodels(assumingnormalerrorsandconstantvariance)followingarcsinetrans-√formation.Theresponsevariable,y,measuredin
8、radians,issin−10.01×p,wherepispercentagecover.If,however,ther