vignettes/survivalAnalysis.Rmd
survivalAnalysis.Rmd
Survival analysis is the analysis of data involving times to some event of interest. However, the event may not be observed for some individuals within the study time period, producing the so-called censored observations.
The next Cornerstone dataset shows the data structure proposed for survival analysis:
Survival Analysis: Data Structure
Censoring data are described by 3 columns:
There are 4 possible situations:
All of the 4 cases may occur with the same data for more than one unit. Therefore it is convenient to have a third column (“count”) where this number can be specified. Typically this will occur for suspended cases but is also allowed for the three other situations.
With the method ‘survivalAnalysis’ in ‘Cornerstone’ from ‘CornerstoneR’, we can fit reliability data with survival times as responses and number of cases having the same data as predictor.
How do we use the method ‘survivalAnalysis’ in ‘Cornerstone’ from ‘CornerstoneR’?
To use a survival analysis model in ‘Cornerstone’ open a dataset, e.g. ‘weibull_lognormal_data’ and choose menu ‘Analysis’ \(\rightarrow\) ‘CornerstoneR’ \(\rightarrow\) ‘Survival Analysis’ as shown in the following screenshot.
Survival Analysis: Menu
In the appearing dialog select ‘Count’ variable to predictor. ‘Lognormal left censoring time’ and ‘Lognormal right censoring time’ are the responses variables. It is only possible to select two responses variable and one predictor variable.
Survival Analysis: Variable Selection
‘OK’ confirms your selection and the following window appears.
Survival Analysis: R Script
Before we start the script, it is necessary to set the following options:
To do this, we open the menu ‘R Script’ \(\rightarrow\) ‘Script Variables’. The screenshot shows the default options.
Survival Analysis: R Script Variables Menu
In the appearing dialog, we select
Survival Analysis: R Script Variables
Now, close this dialog via ‘OK’ and click the execute button (green arrow) or choose the menu ‘R Script’ \(\rightarrow\) ‘Execute’ and all calculations are done via ‘R’. Calculations are done if the text at the lower left status bar contains ‘Last execute error state: OK’. Our result is available via the menu ‘Summaries’ as shown in the following screenshot.
Survival Analysis: Result Menu
The menu ‘Estimation Parameters’ displays the estimation of distribution parameters, the log likelihood and the confidence intervals of distribution parameters.
Via ‘Summaries’ \(\rightarrow\) ‘Estimation Parameters’ the following dataset is shown.
Survival Analysis: Estimation Parameters
The menu ‘Confidence Contours’ is used to create a contour plot for parameter of confidence intervals
Via ‘Summaries’ \(\rightarrow\) ‘Confidence Contours’ the following dataset is shown.
Survival Analysis: Confidence Contours Dataset
To have a better overview of the estimation of distribution parameters, we can have a look at the contour plot for parameter of confidence intervals, by selecting ‘Graphs’ \(\rightarrow\) ‘Contour Plot for parameter CIs’ in the R Script menu. The following window with the requested graph appears.
Survival Analysis: Contour Plot for parameter CIs
The menu ‘Reliability Prediction’ displays the estimation of the cumulative distribution function (CDF) and the confidence intervals of the cumulative distribution function (CDF). This will be used to predict the failure rate.
Via ‘Summaries’ \(\rightarrow\) ‘Reliability Prediction’ the following dataset is shown.
Survival Analysis: Reliability Prediction
To have a better overview of the failure rate predictions with confidence intervals, we can have a look at the line graph, by selecting ‘Graphs’ \(\rightarrow\) ‘Failure Rate Predictions with CI’ in the R Script menu. The following window with the requested graph appears.
Survival Analysis: Failure Rate Predictions with CI
To get a better view of the graph, we need to scale the X-axis by log 10. To do this please select the X-axis, then choose menu ‘Axes’ \(\rightarrow\) ‘Axis Range…’ as shown in the following screenshot.
Survival Analysis: Axes Menu
In the appearing dialog, we select
Survival Analysis: X Axes Range
‘OK’ confirms your selection and the following graph appears.
Survival Analysis: Failure Rate Predictions with CIs