Statistics with R Survival Analysis

Statistics with R Survival Analysis

ID:38924212

大小:59.64 KB

页数:18页

时间:2019-06-21

Statistics with R Survival Analysis_第1页
Statistics with R Survival Analysis_第2页
Statistics with R Survival Analysis_第3页
Statistics with R Survival Analysis_第4页
Statistics with R Survival Analysis_第5页
资源描述:

《Statistics with R Survival Analysis》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、StatisticswithRSurvivalAnalysisScottHetzelUniversityofWisconsin–MadisonSummerInstituteforTraininginBiostatistics(2008)Derivedfrom:“IntroductoryStatisticswithR”by:PeterDalgaardandfrompreviousnotesbyDeepayanSarkar,Ph.DSurvivialAnalysisinR•Toolsareavailableinthepackagesurvival•Thisisarecommendedpackage

2、,whichmeansitshouldalreadybeinstalled•Ithastobeloadedusing>library(survival)•SurvivalAnalysisiscoveredinChapter12ofthetext1FunctionsofInterest•Createasurvivalobject:Surv•Kaplan-MeierEstimates:survfit•Thelog-ranktest:survdiff•TheCoxproportionalhazardsmodel:coxph(wewon’tbediscussingthis)2SurvivalObjec

3、ts•CreatedbytheSurvfunction•Needstwoarguments:–time:follow-uptime–event:statusindicator•event=TRUEmeanseventoccured•event=FALSEindicatescensoring•Othervaluespossible(seehelp(Surv))3Example:melanomWewillusetheexamplefromthetext:>library(ISwR)>str(melanom)'data.frame':205obs.of6variables:$no:int789139

4、716214696857932944...$status:int3323111131...$days:int10303599185204210232232279...$ulc:int1222111111...$thick:int6766513429012084845161288322741...$sex:int2221222211...Weareinterestedin:•days:timeonstudyafteroperationformalignantmelanoma•status:thepatient’sstatusattheendofstudy4CensoringIndicator•T

5、hepossiblevaluesofstatusare–1:deadfrommalignantmelanoma–2:aliveattheendofthestudy–3:deadfromothercauses•Survneedsalogicalstatusindicator(TRUEifeventoccurred,FALSEifcensored)•Let’sconsider”deadfromothercauses”ascensored•Thus,statusvectorshouldbestatus==15CreatingtheSurvivalObject>msurv<-with(melanom,

6、Surv(days,status==1))>msurv[1]10+30+35+99+185204210232232+279295[12]355+386426469493+529621629659667718[23]752779793817826+833858869872967977[34]9821041105510621075115612281252127113121427+[45]14351499+15061508+1510+1512+15161525+1542+15481557+[56]15601563+15841605+16211627+1634+1641+1641+1648+1652+

7、[67]1654+1654+16671678+1685+16901710+1710+17261745+1762+[78]1779+1787+1787+1793+1804+1812+1836+1839+1839+1854+1856+[89]1860+1864+1899+1914+1919+1920+1927+19331942+1955+1956+[100]1958+1963+1970+2005+20

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。