R语言生存分析大全.docx
《R语言生存分析大全.docx》由会员分享,可在线阅读,更多相关《R语言生存分析大全.docx(18页珍藏版)》请在冰豆网上搜索。
R语言生存分析大全
CRANTaskView:
SurvivalAnalysis
Maintainer:
ArthurAllignolandAurelienLatouche
Contact:
arthur.allignolatuni-ulm.de
Version:
2016-01-27
Survivalanalysis,alsocalledeventhistoryanalysisinsocialscience,orreliabilityanalysisinengineering,dealswithtimeuntiloccurrenceofaneventofinterest.However,thisfailuretimemaynotbeobservedwithintherelevanttimeperiod,producingso-calledcensoredobservations.
ThistaskviewaimsatpresentingtheusefulRpackagesfortheanalysisoftimetoeventdata.
Pleaseletthe maintainers knowifsomethingisinaccurateormissing.
StandardSurvivalAnalysis
EstimationoftheSurvivalDistribution
∙Kaplan-Meier:
The survfit functionfromthe survival packagecomputestheKaplan-Meierestimatorfortruncatedand/orcensoreddata. rms (replacementoftheDesignpackage)proposesamodifiedversionofthe survfit function.The prodlim packageimplementsafastalgorithmandsomefeaturesnotincludedin survival.VariousconfidenceintervalsandconfidencebandsfortheKaplan-Meierestimatorareimplementedinthe km.ci package. plot.Surv ofpackage eha plotstheKaplan-Meierestimator.The NADA packageincludesafunctiontocomputetheKaplan-Meierestimatorforleft-censoreddata. svykm in survey providesaweightedKaplan-Meierestimator. nested.km in NestedCohort estimatesthesurvivalcurveforeachlevelofcategoricalvariableswithmissingdata.The kaplan-meier functionin spatstat computestheKaplan-Meierestimatorfromhistogramdata.The MAMSE packagepermitstocomputeaweightedKaplan-Meierestimate.The KM functioninpackage rhosp plotsthesurvivalfunctionusingavariantoftheKaplan-Meierestimatorinahospitalisationriskcontext.The survPresmooth packagecomputespresmoothedestimatesofthemainquantitiesusedforright-censoreddata,i.e.,survival,hazardanddensityfunctions.The asbio packagepermitstocomputetheKaplan-MeierestimatorfollowingPollocketal.(1998).The bpcp packageprovidesseveralfunctionsforcomputingconfidenceintervalsofthesurvivaldistribution(e.g.,betaproductconfidenceprocedure).The lbiassurv packageoffersvariouslength-biascorrectionstosurvivalcurveestimation.Non-ParametricconfidancebandsfortheKaplan-Meierestimatorcanbecomputedusingthe kmconfband package.The kmc packageimplementstheKaplan-Meierestimatorwithconstraints.
∙Non-Parametricmaximumlikelihoodestimation(NPMLE):
The Icens packageprovidesseveralwaystocomputetheNPMLEofthesurvivaldistributionforvariouscensoringandtruncationschemes.MLEcens canalsobeusedtocomputetheMLEforinterval-censoreddata. dblcens permitstocomputetheNPMLEofthecumulativedistributionfunctionforleft-andright-censoreddata.The icfitfunctioninpackage interval computestheNPMLEforinterval-censoreddata.The DTDA implementsseveralalgorithmspermittingtoanalysepossiblydoublytruncatedsurvivaldata.
∙Parametric:
The fitdistrplus packagepermitstofitanunivariatedistributionbymaximumlikelihood.Datacanbeintervalcensored.The vitality packageprovidesroutinesforfittingmodelsinthevitalityfamilyofmortalitymodels.
HazardEstimation
∙The muhaz packagepermitstoestimatethehazardfunctionthroughkernelmethodsforright-censoreddata.
∙The epi.insthaz functionfrom epiR computestheinstantaneoushazardfromtheKaplan-Meierestimator.
∙polspline, gss and logspline allowtoestimatethehazardfunctionusingsplines.
∙The ICE packageaimsatestimatingthehazardfunctionforintervalcensoreddata.
∙The bshazard packageprovidesnon-parametricsmoothingofthehazardthroughB-splines.
Testing
∙The survdiff functionin survival comparessurvivalcurvesusingtheFleming-HarringtonG-rhofamilyoftest. NADA implementsthisclassoftestsforleft-censoreddata.
∙clinfun implementsapermutationversionofthelogranktestandaversionofthelogrankthatadjustsforcovariates.
∙The exactRankTests implementstheshift-algorithmbyStreitbergandRoehmelforcomputingexactconditionalp-valuesandquantiles,possiblyforcensoreddata.
∙SurvTest inthe coin packageimplementsthelogranktestreformulatedasalinearranktest.
∙The maxstat packageperformstestsusingmaximallyselectedrankstatistics.
∙The interval packageimplementslogrankandWilcoxontypetestsforinterval-censoreddata.
∙Threegeneralisedlogranktestsandascoretestforinterval-censoreddataareimplementedinthe glrt package.
∙survcomp compares2hazardratios.
∙The TSHRC implementsatwostageprocedureforcomparinghazardfunctions.
∙The Survgini packageproposestotesttheequalityoftwosurvivaldistributionsbasedontheGiniindex.
∙The FHtest packageoffersseveraltestsbasedontheFleming-Harringtonclassforcomparingsurivalcurveswithright-andinterval-censoreddata.
∙The LogrankA packageprovidesalogranktestforwhichaggregateddatacanbeusedasinput.
∙Theshorttermandlongtermhazardratiomodelfortwosamplessurvivaldatacanbefoundinthe YPmodel package.
RegressionModelling
∙Coxmodel:
The coxph functioninthe survival packagefitstheCoxmodel. cph inthe rms packageandthe eha packageproposesomeextensionstothe coxph function.Thepackage coxphf implementstheFirth'spenalisedmaximumlikelihoodbiasreductionmethodfortheCoxmodel.AnimplementationofweightedestimationinCoxregressioncanbefoundin coxphw.The coxrobust packageproposesarobustimplementationoftheCoxmodel. timecox inpackage timereg fitsCoxmodelswithpossiblytime-varyingeffects.The mfp packagepermitstofitCoxmodelswithmultiplefractionalpolynomial.The NestedCohort fitsCoxmodelsforcovariateswithmissingdata.ACoxmodelmodelcanbefittedtodatafromcomplexsurveydesignusingthe svycoxph functionin survey.The multipleNCC packagefitsCoxmodelsusingaweightedpartiallikelihoodfornestedcase-controlstudies.The intcox packageimplementstheCoxmodelforinterval-censoreddatausingtheICM-algorithm.The MIICD packageimplementsPan's(2000)multipleimputationapproachtoCoxmodelsforintervalcensoreddata.The ICsurv packagefitsCoxmodelsforinterval-censoreddatathroughanEMalgorithm.The dynsurvpackagefitstime-varyingcoefficientmodelsforintervalcensoredandrightcensoredsurvivaldatausingaBayesianCoxmodel,asplinebasedCoxmodeloratransformationmodel.The CPHshapepackagecomputestheCoxproportionalhazardsmodelwithshapeconstrainedhazardfunctions.The OrdFacReg packageimplementstheCoxmodelusinganactivesetalgorithmfordummyvariablesoforderedfactors.The survivalMPL packagefitsCoxmodelsusingmaximumpenalisedlikelihoodandprovideanonparametricsmoothestimateofthebaselinehazardfunction.
The cumres functionin gof computesgoodness-of-fitmethodsfortheCoxproportionalhazardsmodel.Theproportionalityassumptioncanbecheckedusingthe cox.zph functionin survival.The CPEpackagecalculatesconcordanceprobabilityestimatefortheCoxmodel,asdoesthe coxphCPE functionin clinfun.The coxphQuantile inthelatterpackagedrawsaquantilecurveofthesurvivaldistributionasafunctionofcovariates.The multcomp packagecomputessimultaneoustestsandconfidenceintervalsfortheCoxmodelandotherparametricsurvivalmodels.The lsmeans packagepermitstoobtainleast-squaresmeans(andcontraststhereof)fromlinearmodels.Inparticular,itprovidessupportforthe coxph, survreg and coxme functions.The multtest packageonBioconductorproposesaresamplingbasedmultiplehypothesistestingthatcanbeappliedtotheCoxmodel.TestingcoefficientsofCoxregressionmodelsusingaWaldtestwithasandwichestimatorofvariancecanbedoneusingthe sawspackage.The rankhazard packagepermitstoplotvisualisationoftherelativeimportanceofcovariatesinaproportionalhazardsmodel.The smoothHR packageprovideshazardratiocurvesthatallowsfornonlinearrelationshipbetweenpredictorandsurvival.The paf packagepermitstocomputetheunadjusted/adjustedattributablefractionfunctionfromaCoxproportionalhazardsmodel.The PHevalpackageproposestoolstochecktheproportionalhazardsassumptionusingastandardisedscoreprocess.
∙ParametricProportionalHazardsModel:
survreg (from survival)fitsaparametricproportionalhazardsmodel.The eha and mixPHM packagesimplementaproportionalhazardsmodelwithaparametricbaselinehazard.The pphsm in rms translatesanAFTmodeltoaproportionalhazardsform.The polspline packageincludesthe hare functionthatfitsahazardregressionmodel,usingsplinestomodelthebaselinehazard.Hazardscanbe,butnotnecessarily,proportional.The flexsurv packageimplementsthemodelofRoystonandParmar(2002).Themodelusesnaturalcubicsplinesforthebaselinesurvivalfunction,andproportionalhazards,proportionaloddsorprobitfunctionsforregression.
∙AcceleratedFailureTime(AFT)Models:
The survreg functioninpackage survival canfitanacceleratedfailuretimemodel.Amodifiedversionof survreg isimplementedinthe rms package( psmfunction).Itpermitstousesomeofthe rms functionalities.The eha packagealsoproposesanimplementationoftheAFTmodel(function aftreg).AnAFTmodelwithanerrordistributionassumedtobeamixtureofG-splinesisimplementedinthe smoothSurv package.The NADA packageproposesthefrontendofthe survreg functionforleft-censoreddata.Aleast-squareprincipledimplementationoftheAFTmodelcanbefoundinthe lss package.The simexaft packageimplementstheSimulation-ExtrapolationalgorithmfortheAFTmodel,thatcanbeusedwhencovariatesaresubjecttomeasurementerror.Arobustversionoftheacceleratedfailuretimemodelcanbef