Description Usage Arguments Examples
This function plots estimates of the survival or cumulative hazard for each group, coloured according to the latent population that each group belongs to.
1 2 3 |
x |
A fitted nonparametric discrete frailty model, as returned by |
type |
character. If |
cols |
Vector of colour names or numbers, of the same length as the number of groups. If not given, this defaults to |
survfit_opts |
Optional list of additional arguments to pass to |
na_opts |
Optional list of arguments (other than |
... |
Optional arguments to pass to |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | result = npdf_cox( Surv(time, status) ~ x, groups = family, data = weibdata2030,
K = 2, estK = FALSE, eps_conv=10^-4)
plot( result )
plot( result, type = "km" )
plot( result, cols = ifelse( result$belonging == 1, "purple", "black" ), xlim = c( 0, 150 ) )
## use of survfit_opts. show only first 10 groups
plot( result, survfit_opts = list(subset = (weibdata2030$family >= 10) ))
plot( result, type = "na" )
## use of na_opts to customise the Nelson-Aalen plot
plot( result, type = "na", cols=ifelse(result$belonging==2, "purple", "black"),
na_opts = list(xlim=c(0,200), ylim=c(0,2),
xlab="Follow-up days",
ylab="Nelson-Aalen estimate"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.