{"id":516,"date":"2015-08-01T11:32:48","date_gmt":"2015-08-01T10:32:48","guid":{"rendered":"http:\/\/pcool.dyndns.org:8080\/statsbook\/?page_id=516"},"modified":"2025-07-04T22:00:33","modified_gmt":"2025-07-04T21:00:33","slug":"survival-analysis","status":"publish","type":"page","link":"https:\/\/pcool.dyndns.org\/index.php\/survival-analysis\/","title":{"rendered":"Survival Analysis"},"content":{"rendered":"\n<p>In this section <a href=\"https:\/\/pcool.dyndns.org\/index.php\/life-table-survival-analysis\/\" data-type=\"page\" data-id=\"522\">Life Table Survival Analysis<\/a> and <a href=\"https:\/\/pcool.dyndns.org\/index.php\/kaplan-meier-survival-analysis\/\" data-type=\"page\" data-id=\"519\">Kaplan-Meier Survival Analysis<\/a> are described. When the exact failure time is known, Kaplan-Meier analysis is preferred and Life Table analysis is mostly obsolete. However, it is discussed here for illustrative and educational purposes.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Survival analysis calculates the cumulative probability of survival for a group of patients between two events: the start date \/ time and the end date \/ time.<\/li>\n\n\n\n<li>In survival analysis it is essential to define a <strong>\u2018hard end point\u2019 <\/strong><a href=\"https:\/\/pcool.dyndns.org\/index.php\/data-types\/\" data-type=\"page\" data-id=\"355\">(binary outcome measure)<\/a> for the event of interest.<\/li>\n\n\n\n<li>The most elementary method is life table survival analysis. However, when the exact survival time is known this method is mostly obsolete.<\/li>\n\n\n\n<li>For medical purposes, the preferred method is Kaplan-Meier survival analysis.<\/li>\n\n\n\n<li>Patients are called <strong><em>uncensored<\/em><\/strong> if the event of interest has occurred.<\/li>\n\n\n\n<li>All other patients are <strong><em>censored; <\/em><\/strong>the event of interest has not yet occurred, patient are withdrawn from follow up or have been lost to follow up.<\/li>\n\n\n\n<li>In life table analysis,<em> censored<\/em> patients are at risk of the event of interest for only part of that year.<\/li>\n\n\n\n<li>The survival curve is stepped at yearly intervals in life table survival analysis.<\/li>\n\n\n\n<li>In Kaplan-Meier survival analysis, the curve is also <strong>stepped<\/strong>. However, the steps are at the times the event of interest has occurred (and are therefore not regular). If there are many of these events, the curve will have a smooth appearance (but when magnified, will always stay stepped!).<\/li>\n\n\n\n<li>The <strong>\u2018tail end\u2019<\/strong> of the survival curve can give a <strong>wrong impression<\/strong> if the number of patients remaining in follow up is low.<\/li>\n\n\n\n<li>The <strong>five-year survival<\/strong> is the cumulative probability of being alive after 5 years.<\/li>\n\n\n\n<li>The <strong>median survival<\/strong> is the time it takes for the cumulative survival to be 50%.<\/li>\n<\/ul>\n\n\n\n<p>The survival package<sup class='sup-ref-note' id='note-zotero-ref-p516-r1-o1'><a class='sup-ref-note' href='#zotero-ref-p516-r1'>1<\/a><\/sup> should be <a href=\"https:\/\/pcool.dyndns.org\/index.php\/packages\/\" data-type=\"page\" data-id=\"22\">installed and loaded<\/a> to perform survival analysis in R.<\/p>\n\n\n\n<p><strong>Using the console:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a survival object (ie: mysurvival)<\/strong><\/li>\n\n\n\n<li><em><span style=\"color: #ff0000;\">mysurvival &lt;- Surv(FU time, Event)<\/span><\/em><\/li>\n\n\n\n<li><strong>Fit the survival curve on the survival object (95% conf levels)<\/strong><\/li>\n\n\n\n<li><span style=\"color: #ff0000;\"><em>mycurve &lt;- survfit(mysurvival~1, conf.int=0.95)<\/em><\/span><\/li>\n\n\n\n<li><strong>Plot the survival curve<\/strong><\/li>\n\n\n\n<li><em><span style=\"color: #ff0000;\">plot(mycurve)<\/span><\/em><\/li>\n<\/ul>\n\n\n\n<p><strong>Logrank test:<\/strong><\/p>\n\n\n\n<p><span style=\"color: #ff0000;\"><em>mycompare &lt;- survdiff(mysurvival~group)<\/em><\/span><\/p>\n\n\n\n<p><strong>Cox proportional hazards:<\/strong><\/p>\n\n\n\n<p><span style=\"color: #ff0000;\"><em>mycompare &lt;- coxph(mysurvival~group)<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this section Life Table Survival Analysis and Kaplan-Meier Survival Analysis are described. When the exact failure time is known, Kaplan-Meier analysis is preferred and Life Table analysis is mostly obsolete. However, it is discussed here for illustrative and educational purposes. The survival package should be installed and loaded to perform survival analysis in R. [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"footnotes":""},"class_list":["post-516","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":1,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/516\/revisions"}],"predecessor-version":[{"id":4931,"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/pages\/516\/revisions\/4931"}],"wp:attachment":[{"href":"https:\/\/pcool.dyndns.org\/index.php\/wp-json\/wp\/v2\/media?parent=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}