plot.bivrec: Plot of survivor function for bivrec or unirec objects

Description Usage Arguments See Also Examples

View source: R/bivmethods.r

Description

Function to plot the the survivor function estimated by bivrec or unirec.

Usage

1
2
3
4
5
6
## S3 method for class 'bivrec'
plot(x, which = c(0,1,2), main=NULL,
    xscale = 1, hazscale = 1, add = FALSE, legend = NULL, ...)
    
## S3 method for class 'unirec'
plot(x, main=NULL, xscale = 1, hazscale = 1, add = FALSE,...)

Arguments

x

an object of type bivrec or unirec.

which

an integer that determines which plot to draw. If 0, plots are drawn for both processes, if 1 or 2, a plot is drawn for process 1 or 2 respectively.

main

for bivrec, a character vector of length 2, with two plot titles, for unirec, a string giving the main title.

xscale

amount by which to scale the x axis (for example to convert time from days to years). The hazard is automatically scaled accordingly.

hazscale

additional scaling for the hazard.

add

logical, whether to add the lines to the current plot or create a new plot.

legend

logical, whether to draw a legend.

...

additional parameters passed on to plot

See Also

bivrec, unirec

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
    data(m10Ji5.fit) # Example fitted model (see example(bivrec))
    
    # Default plot of the survivor function of the first process
    plot(m10Ji5.fit, which=1, main="Example Plot")
    
    # Add a line showing the effect of the covariate
    plot(m10Ji5.fit, which=1, 
        hazscale=exp(m10Ji5.fit$regression$coefficients1["Z1"]), 
        add=TRUE, lty=2)
        
    legend("topright", c("Z1 = 0", "Z1 = 1"), lty=c(1,2)) 

blupsurv documentation built on May 2, 2019, 6:51 p.m.