plotData {drcte} | R Documentation |
Data for plotting fitted time-to-event models
Description
plotData
returns the data for plotting a regression model with other plotting packages, such as ggplot2
Usage
plotData(x, xlim, confidence.level = 0.95, gridsize = 100,
type = c("average", "all", "bars", "none", "obs", "confidence"),
npmle.type = c("interpolation", "midpoint", "right", "left","none"))
Arguments
x |
an object of class 'drcte' or 'drc'. |
xlim |
as in the basic plot method: the x-range for plotting |
confidence.level |
For confidence intervals |
gridsize |
the gridsize for predictions |
type |
it has been left for analogy with the plot method for 'drc' objects, but it is neglected in the case of 'drcte' objects. |
npmle.type |
the NPMLE of the cumulative density function is only specified at the end of each inspection interval, while it is not unique within each interval. This argument specifies how the CDF increases within each interval: possible values are "interpolation" (it is assumed that the CDF increases progressively), "left" (the CDF increases at the beginning of each interval), "right" (the CDF increases at the end of each interval; it is very common in survival analysis) and "midpoint" (the CDF increases in the middle of each interval; it is very common in survival analysis). This argument is neglected with parametric and KDE fits. |
Details
The plotData method for 'drcte' objects is used to get the data for plotting with ggplot2.
Value
A list with two elements. The first element (plotPoints) contains the data for plotting the observed values, the second element (plotFits) contains the data for plotting curves.
Author(s)
Andrea Onofri
Examples
library(drcte)
data(verbascum)
mod <- drmte(nSeeds ~ timeBef + timeAf, fct = LL.3(),
data = verbascum, curveid = Species)
plotData(mod)