plot.simfrail: Plot method for 'simfrail' objects

View source: R/plot.simfrail.R

plot.simfrailR Documentation

Plot method for simfrail objects

Description

Plot the estimated parameter residuals or the mean estimated cumulative baseline hazard.

Usage

## S3 method for class 'simfrail'
plot(x, type = c("residuals", "cumhaz"), ...)

Arguments

x

a fitfrail object

type

string, the type of plot. Can be either "residuals" or "cumhaz". If type="residuals", a boxplot of the estimated parameter residuals is created. If type="cumhaz", the mean estimated and true cumulative baseline hazard are plotted.

...

extra arguments include:

CI for type="cumhaz", the confidence interval for the empirical cumulative baseline hazard.

n.Lambda for type="residuals", the number of time points to show the cumulative baseline hazard residuals for.

Value

The plot object.

Author(s)

John. V Monaco, Malka Gorfine, Li Hsu

See Also

simfrail

Examples

## Not run: 
set.seed(2015)
sim <- simfrail(1000,
    genfrail.args=alist(beta=c(log(2),log(3)), frailty="gamma", 
                        censor.rate=0.30, N=300, K=2, theta=2,
                        covar.distr="uniform", covar.param=c(0, 1),
                        Lambda_0=function(t, tau=4.6, C=0.01) (C*t)^tau), 
    fitfrail.args=alist(formula=Surv(time, status) ~ Z1 + Z2 
                                                   + cluster(family), 
                        frailty="gamma"),
    Lambda.times=1:120)

# Make a boxplot of residuals
plot(sim, type="residuals")

# Plot the mean estimated cumulative baseline hazard and empirical 0.95 CI
plot(sim, type="cumhaz")

## End(Not run)

frailtySurv documentation built on Aug. 14, 2023, 1:06 a.m.