Debian Codegraph @

man/plot.MarkovTest.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/plot.MarkovTest.R
3 \name{plot.MarkovTest}
4 \alias{plot.MarkovTest}
5 \title{Plot method for a MarkovTest object}
6 \usage{
7 \method{plot}{MarkovTest}(
8 x,
9 y,
10 what = c("states", "overall"),
11 idx = NULL,
12 quantiles = TRUE,
13 qsup,
14 states,
15 xlab,
16 ylab,
17 main,
18 ...
19 )
20 }
21 \arguments{
22 \item{x}{Object of class 'MarkovTest'}
23
24 \item{y}{The grid at which \code{MarkovTest} was calculated}
25
26 \item{what}{Choose "states" for plotting state-specific traces, and
27 "overall" for the overall chi-squared trace}
28
29 \item{idx}{Vector of indices of wild bootstrap traces to plot}
30
31 \item{quantiles}{Boolean whether or not to plot the 2.5 and 97.5 percent
32 quantiles, default is \code{TRUE}}
33
34 \item{qsup}{The index of the function in either \code{fn} (when plotting
35 state-specific) or \code{fn2} (when plotting overall) to plot along with the
36 traces; when missing this line is not included}
37
38 \item{states}{Number of the qualifying state(s) to plot trace for}
39
40 \item{xlab}{Text for x-axis label}
41
42 \item{ylab}{Text for y-axis label}
43
44 \item{main}{Text for title (main)}
45
46 \item{\dots}{Further arguments to plot}
47 }
48 \value{
49 No return value
50 }
51 \description{
52 Plot method for an object of class 'MarkovTest'. It plots the trace of the
53 log-rank statistics provided by \code{\link{MarkovTest}}.
54 }
55 \examples{
56
57 \dontrun{
58 # Example provided by the prothrombin data
59 data("prothr")
60 # Apply Markov test to grid of monthly time points over the first 7.5 years
61 year <- 365.25
62 month <- year / 12
63 grid <- month * (1:90)
64 # Markov test for transition 1 (wild bootstrap based on 100 replications)
65 MT <- MarkovTest(prothr, id = "id", transition = 1,
66 grid = grid, B = 100)
67
68 plot(MT, grid, what="states", idx=1:50, states=rownames(attr(prothr, "trans")),
69 xlab="Days since randomisation", ylab="Log-rank test statistic",
70 main="Transition Normal -> Low")
71
72 plot(MT, grid,what="overall", idx=1:50,
73 xlab="Days since randomisation", ylab="Chi-square test statistic",
74 main="Transition Normal -> Low")
75
76 plot(MT, grid, what="states", quantiles=FALSE) # only trace
77 plot(MT, grid, what="states") # trace plus quantiles (default)
78 plot(MT, grid, what="states", idx=1:10) # trace plus quantiles, plus first 10 bootstrap traces
79
80 plot(MT, grid, what="overall", quantiles=FALSE) # only trace
81 plot(MT, grid, what="overall") # trace plus quantiles (default)
82 plot(MT, grid, what="overall", idx=1:10) # trace plus quantiles, plus first 10 bootstrap traces
83
84 }
85
86 }
87 \seealso{
88 \code{\link{MarkovTest}}
89 }
90 \author{
91 Hein Putter \email{[email protected]}
92 }
93 \keyword{hplot}