Get startedGet started for free

Visualizing the results of Weibull models

1. Visualizing the results of a Weibull model

In the last video we discussed how to compute the survival curve from a Weibull model and we also practiced this during the exercises. In this video, we will discuss how to use this information for plotting.

2. Visualizing a Weibull model

The reason we need to compute the survival function first is that the plotting tools in survminer focus mostly on step functions like the Kaplan-Meier estimate at the moment. So using ggsurvplot() as we did for Kaplan-Meier does not work here. No need to be frustrated though. It is actually not that difficult either!

3. Visualizing a Weibull model

In order to be able to plot the survival curve estimated by the Weibull model, we need to specify a data frame with specific variables: time, surv, upper, lower and std-dot-err, which stand for standard error. The last three are not relevant for us at the moment so we set them to NA. Then we can use this data frame with the ggsurvplot_df() function. This function takes only data frames of the format we specified. The argument surv-dot-geom lets us specify that our model generates a smooth function and thus we need geom_line instead of geom_step, which we would need to use for plotting the Kaplan-Meier curve. Now let's take a look at the result.

4. Visualising a Weibull model

We see a beautiful smooth survival function. In the exercises, we will try to recreate this beautiful plot, and in the next chapter, we will start working with covariates in the Weibull model in order to learn even more about the breast cancer patients.

5. Let's practice!

But first, let's do some exercises!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.