plot.simfrail: Plot method for 'simfrail' objects

Description Usage Arguments Value Author(s) See Also Examples

View source: R/plot.simfrail.R

Description

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

Usage

1
2
## 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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. 29, 2018, 1:04 a.m.