plot.dynreg {timereg}R Documentation

Plots estimates and test-processes

Description

This function plots the non-parametric cumulative estimates for the additive risk model or the test-processes for the hypothesis of constant effects with re-sampled processes under the null.

Usage

## S3 method for class 'dynreg'
plot(
  x,
  type = "eff.smooth",
  pointwise.ci = 1,
  hw.ci = 0,
  sim.ci = 0,
  robust = 0,
  specific.comps = FALSE,
  level = 0.05,
  start.time = 0,
  stop.time = 0,
  add.to.plot = FALSE,
  mains = TRUE,
  xlab = "Time",
  ylab = "Cumulative coefficients",
  score = FALSE,
  ...
)

Arguments

x

the output from the "dynreg" function.

type

the estimator plotted. Choices "eff.smooth", "ms.mpp", "0.mpp" and "ly.mpp". See the dynreg function for more on this.

pointwise.ci

if >1 pointwise confidence intervals are plotted with lty=pointwise.ci

hw.ci

if >1 Hall-Wellner confidence bands are plotted with lty=hw.ci. Only 0.95 % bands can be constructed.

sim.ci

if >1 simulation based confidence bands are plotted with lty=sim.ci. These confidence bands are robust to non-martingale behaviour.

robust

robust standard errors are used to estimate standard error of estimate, otherwise martingale based estimate are used.

specific.comps

all components of the model is plotted by default, but a list of components may be specified, for example first and third "c(1,3)".

level

gives the significance level.

start.time

start of observation period where estimates are plotted.

stop.time

end of period where estimates are plotted. Estimates thus plotted from [start.time, max.time].

add.to.plot

to add to an already existing plot.

mains

add names of covariates as titles to plots.

xlab

label for x-axis.

ylab

label for y-axis.

score

to plot test processes for test of time-varying effects along with 50 random realization under the null-hypothesis.

...

unused arguments - for S3 compatibility

Author(s)

Thomas Scheike

References

Martinussen and Scheike, Dynamic Regression Models for Survival Data, Springer (2006).

Examples



### runs slowly and therefore donttest 
data(csl)
indi.m<-rep(1,length(csl$lt))

# Fits time-varying regression model
out<-dynreg(prot~treat+prot.prev+sex+age,csl,
Surv(lt,rt,indi.m)~+1,start.time=0,max.time=3,id=csl$id,
n.sim=100,bandwidth=0.7,meansub=0)

par(mfrow=c(2,3))
# plots estimates 
plot(out)
# plots tests-processes for time-varying effects 
plot(out,score=TRUE)



[Package timereg version 2.0.5 Index]