Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.MarkovTest

Plot method for a MarkovTest object


Description

Plot method for an object of class 'MarkovTest'. It plots the trace of the log-rank statistics provided by MarkovTest.

Usage

## S3 method for class 'MarkovTest'
plot(
  x,
  y,
  what = c("states", "overall"),
  idx = NULL,
  quantiles = TRUE,
  qsup,
  states,
  xlab,
  ylab,
  main,
  ...
)

Arguments

x

Object of class 'MarkovTest'

y

The grid at which MarkovTest was calculated

what

Choose "states" for plotting state-specific traces, and "overall" for the overall chi-squared trace

idx

Vector of indices of wild bootstrap traces to plot

quantiles

Boolean whether or not to plot the 2.5 and 97.5 percent quantiles, default is TRUE

qsup

The index of the function in either fn (when plotting state-specific) or fn2 (when plotting overall) to plot along with the traces; when missing this line is not included

states

Number of the qualifying state(s) to plot trace for

xlab

Text for x-axis label

ylab

Text for y-axis label

main

Text for title (main)

...

Further arguments to plot

Value

No return value

Author(s)

Hein Putter H.Putter@lumc.nl

See Also

Examples

## Not run: 
# Example provided by the prothrombin data
data("prothr")
# Apply Markov test to grid of monthly time points over the first 7.5 years
year <- 365.25
month <- year / 12
grid <- month * (1:90)
# Markov test for transition 1 (wild bootstrap based on 100 replications)
MT <- MarkovTest(prothr, id = "id", transition = 1,
                 grid = grid, B = 100)

plot(MT, grid, what="states", idx=1:50, states=rownames(attr(prothr, "trans")),
     xlab="Days since randomisation", ylab="Log-rank test statistic",
     main="Transition Normal -> Low")

plot(MT, grid,what="overall", idx=1:50,
     xlab="Days since randomisation", ylab="Chi-square test statistic",
     main="Transition Normal -> Low")

plot(MT, grid, what="states", quantiles=FALSE) # only trace
plot(MT, grid, what="states") # trace plus quantiles (default)
plot(MT, grid, what="states", idx=1:10) # trace plus quantiles, plus first 10 bootstrap traces
 
plot(MT, grid, what="overall", quantiles=FALSE) # only trace
plot(MT, grid, what="overall") # trace plus quantiles (default)
plot(MT, grid, what="overall", idx=1:10) # trace plus quantiles, plus first 10 bootstrap traces


## End(Not run)

mstate

Data Preparation, Estimation and Prediction in Multi-State Models

v0.3.1
GPL (>= 2)
Authors
Hein Putter [aut, cre], Liesbeth C. de Wreede [aut], Marta Fiocco [aut], Ronald B. Geskus [ctb], Edouard F. Bonneville [ctb], Damjan Manevski [ctb]
Initial release
2020-12-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.