library('knitr') read_chunk('../q1.R') opts_chunk$set(cache=FALSE, fig.width=7, fig.height=6) options(width=90)
The results are contained in an Excel file and are also shown in the R output below.
First, load the biostat3
library for the dataset , survminer
for plots and knitr
for nice html output:
Following are the life table estimates. Note that in the lectures, when we estimated all-cause survival, there were 8 deaths in the first interval. One of these died of a cause other than cancer so in the cause-specific survival analysis we see that there are 7 ‘deaths’ and 1 censoring (Stata uses the term ‘lost’ for lost to follow-up) in the first interval.
Following is a table of Kaplan-Meier estimates. Although it’s not clear from the table, the person censored (lost) at time 2 was at risk when the other person dies at time 2. On the following is a graph of the survival function.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.