| autoplot.pcd | R Documentation |
Draws the observation pattern as tiles: one row per subject, one tile per examination interval spanning the time it covers, shaded by the number of events recorded in it.
## S3 method for class 'pcd'
autoplot(
object,
order_by = c("followup", "events", "none"),
max_subjects = 60L,
palette = NULL,
...
)
## S3 method for class 'pcd'
plot(x, ...)
object, x |
A |
order_by |
How to order subjects up the vertical axis. |
max_subjects |
Draw at most this many subjects, taken as an evenly spaced sample so the picture stays readable for large studies. A message reports how many were shown. |
palette |
Fill colours, lightest first. The default is a single-hue sequential ramp, which is where a magnitude belongs. |
... |
Ignored. |
The tile is the unit of observation. A panel count is attributed to the
interval (T_{i,j-1}, T_{ij}] rather than to an instant, so drawing the
intervals rather than points at the examination times is what the data
actually says: a wide pale tile and a narrow dark one can carry the same
count while meaning very different things about the rate.
Two features decide how an analysis will go and both are visible here. Whether examination times line up across subjects sets the size of the pooled grid and so the cost of fitting the rate model; and how ragged the right hand edge is shows how much of the tail of the baseline rests on a handful of subjects.
A ggplot2::ggplot() object, so it can be titled, faceted or
themed like any other. autoplot() returns it; plot() draws it and
returns it invisibly, so it can be used for its side effect like any
other plot() method.
autoplot.pcdfit() for the fitted baseline function.
set.seed(1)
d <- sim_pcd(40)
autoplot(with(d, pcd(id, tstart, tstop, count)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.