plot.summary.sievePH: Plotting Mark-Specific Proportional Hazards Model Fits

View source: R/plot.summary.sievePH.R

plot.summary.sievePHR Documentation

Plotting Mark-Specific Proportional Hazards Model Fits

Description

plot method for class summary.sievePH. For univariate marks, it plots point and interval estimates of the mark-specific treatment effect parameter specified by contrast in summary.sievePH, and, optionally, scatter/box plots of the observed mark values by treatment. For bivariate marks, plotting is restricted to the point estimate, which is displayed as a surface. No plotting is provided for marks of higher dimensions.

Usage

## S3 method for class 'summary.sievePH'
plot(
  x,
  mark = NULL,
  tx = NULL,
  xlim = NULL,
  ylim = NULL,
  zlim = NULL,
  xtickAt = NULL,
  xtickLab = NULL,
  ytickAt = NULL,
  ytickLab = NULL,
  xlab = NULL,
  ylab = NULL,
  zlab = NULL,
  txLab = c("Placebo", "Treatment"),
  title = NULL,
  ...
)

Arguments

x

an object returned by summary.sievePH

mark

either a numeric vector specifying a univariate continuous mark or a data frame specifying a multivariate continuous mark. For subjects with a right-censored time-to-event, the value(s) in mark should be set to NA.

tx

a numeric vector indicating the treatment group (1 if treatment, 0 if placebo)

xlim

a numeric vector of length 2 specifying the x-axis range (NULL by default)

ylim

a numeric vector of length 2 specifying the y-axis range (NULL by default)

zlim

a numeric vector of length 2 specifying the z-axis range in a 3-dimensional plot (NULL by default)

xtickAt

a numeric vector specifing the position of x-axis tickmarks (NULL by default)

xtickLab

a numeric vector specifying labels for tickmarks listed in xtickAt. If NULL (default), the labels are determined by xtickAt.

ytickAt

a numeric vector specifing the position of y-axis tickmarks (NULL by default)

ytickLab

a numeric vector specifying labels for tickmarks listed in ytickAt. If NULL (default), the labels are determined by ytickAt.

xlab

a character string specifying the x-axis label (NULL by default)

ylab

a character string specifying the y-axis label (NULL by default)

zlab

a character string specifying the z-axis label in a 3-dimensional plot (NULL by default)

txLab

a character vector of length 2 specifying the placebo and treatment labels (in this order). The default labels are placebo and treatment.

title

a character string specifying the plot title (NULL by default)

...

other arguments to be passed to plotting functions

Details

For bivariate marks, markGrid in summary.sievePH must have equally spaced values for each component.

Value

None. The function is called solely for plot generation.

See Also

sievePH, sievePHipw, sievePHaipw and summary.sievePH

Examples

n <- 500
tx <- rep(0:1, each=n/2)
tm <- c(rexp(n/2, 0.2), rexp(n/2, 0.2 * exp(-0.4)))
cens <- runif(n, 0, 15)
eventTime <- pmin(tm, cens, 3)
eventInd <- as.numeric(tm <= pmin(cens, 3))
mark <- ifelse(eventInd==1, c(rbeta(n/2, 2, 5), rbeta(n/2, 2, 2)), NA)
markRng <- range(mark, na.rm=TRUE)

# fit a model with a univariate mark
fit <- sievePH(eventTime, eventInd, mark, tx)
sfit <- summary(fit, markGrid=seq(markRng[1], markRng[2], length.out=10))
plot(sfit, mark, tx)


sievePH documentation built on Feb. 16, 2023, 9:55 p.m.