| print.coat | R Documentation |
Extracting information from or visualization of conditional method agreement trees. Visualizations use trees with Bland-Altman plots in terminal nodes, drawn via grid graphics.
## S3 method for class 'coat'
print(
x,
digits = 2L,
header = TRUE,
footer = TRUE,
title = "Conditional method agreement tree (COAT)",
...
)
## S3 method for class 'coat'
coef(object, node = NULL, drop = TRUE, ...)
## S3 method for class 'coat'
plot(x, terminal_panel = node_baplot, tnex = 2, drop_terminal = TRUE, ...)
node_baplot(
obj,
level = 0.95,
digits = 2,
pch = 1,
cex = 0.5,
col = 1,
linecol = 4,
lty = c(1, 2),
bg = "white",
confint = FALSE,
B = 500,
cilevel = 0.95,
cicol = "lightgray",
xscale = NULL,
yscale = NULL,
ylines = 3,
id = TRUE,
mainlab = NULL,
gp = gpar()
)
x, object, obj |
a |
digits |
numeric. Number of digits used for rounding the displayed coefficients or limits of agreement. |
header, footer |
logical. Should a header/footer be printed for the tree? |
title |
character with the title for the tree. |
... |
further arguments passed to methods. |
node |
integer. ID of the node for which the Bland-Altman parameters (coefficients) should be extracted. |
drop |
logical. Should the matrix attribute be dropped if the parameters from only a single node are extracted? |
terminal_panel |
a panel function or panel-generating function passed to
|
tnex |
numeric specification of the terminal node extension relative to the inner nodes (default is twice the size). |
drop_terminal |
logical. Should all terminal nodes be "dropped" to the bottom row? |
level |
numeric level for the limits of agreement. |
pch, cex, col, linecol, lty, bg |
graphical parameters for the scatter plot and limits of agreement in the Bland-Altman plot (scatter plot character, character extension, plot color, line color, line types, and background color). |
confint |
logical. Should nonparametric bootstrap percentile confidence intervals be plotted? |
B |
numeric. Number of bootstrap samples to be used if |
cilevel |
numeric. Level of the confidence intervals if |
cicol |
color specification for the confidence intervals if |
xscale, yscale |
numeric specification of scale of x-axis and y-axis, respectively. By default the range of all scatter plots and limits of agreement across all nodes are used. |
ylines |
numeric. Number of lines for spaces in y-direction. |
id |
logical. Should node IDs be plotted? |
mainlab |
character or function. An optional title for the plots. Either
a character or a |
gp |
grid graphical parameters. |
Various methods are provided for trees fitted by coat,
in particular print, plot (via grid/partykit) and
coef. The plot method draws Bland-Altman plots in the terminal panels by default,
using the function node_baplot.
In addition to these dedicated coat methods, further methods are inherited
from ctree or mob, respectively,
depending on which type of coat was fitted.
The print() method returns the printed object invisibly.
The coef() method returns the vector (for a single node) or matrix (for multiple nodes) of estimated parameters (bias and standard deviation).
The plot() method returns NULL.
The node_baplot() panel-generating function returns a function that can be plugged into the plot() method.
## package and data (reshaped to wide format)
library("coat")
data("scint", package = "MethComp")
scint_wide <- reshape(scint, v.names = "y", timevar = "meth", idvar = "item", direction = "wide")
## conditional method agreement tree
tr <- coat(y.DTPA + y.DMSA ~ age + sex, data = scint_wide)
## illustration of methods (including some customization)
## printing
print(tr)
print(tr, header = FALSE, footer = FALSE)
## extracting Bland-Altman parameters
coef(tr)
coef(tr, node = 1)
## visualization (via grid with node_baplot)
plot(tr)
plot(tr, ip_args = list(id = FALSE),
tp_args = list(col = "slategray", id = FALSE, digits = 3, pch = 19))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.