資源描述:
《the r book proportion data》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
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