Description Usage Arguments Value See Also Examples
Barplot of frequencies, densities or both of the two distributions of patients with and without the targeted condition.
1 2 3 4 5 6 7 8 9 10 |
ref |
Vector of patient status with two ordered values. The first indicates the patients without the targeted condition (for instance 0), the second indicates the patients with the targeted condition (for instance 1). This order is relevant. |
test |
Vector of ordinal test scores. The values range from min(test) to max(test) and need to be ordered. Missing values in between are shown in the plots as gaps. |
name.test |
Name used for the title of the x axis. |
fixed.range |
Default = NULL. If test has numeric values you can set the
values to cover a fixed range. This may enable the comparison of different
samples with truncated test values. Default: use |
plot |
Default: 'frequencies'. Which plots to create: 'frequencies', 'densities' or 'both'. |
target.condition |
Default: 'Target Condition'. Name of target condition. |
position.legend |
Default: 'top'. Position of the legend. Most used values: "topleft", "top", "topright". |
cex.legend |
Default: 1. Relative size of the legend. |
named matrix with 2 rows and max(test)-min(test)+1 columns that provide for the position on the x-axis of each of the test values. These values can be used to draw vertical lines to indicate cutoff scores (see example).
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(tostbegg2)
barplotMD(ref=tostbegg2$d, test=tostbegg2$y, name='Metastatic Rating', cex=1)
x.axis = barplotMD(ref=tostbegg2$d, test=tostbegg2$y, plot='densities',
name='Metastatic Rating', cex=1)
# Use x.axis to plot vertical line between test score 3 and 4
segments(x0=(x.axis[2,4]+x.axis[1,3])/2, y0=0, y1=.4, col='red')
# include zero score (in this sample empty)
barplotMD(ref=tostbegg2$d, test=tostbegg2$y, fixed.range = c(0, 5),
plot='densities',name='Metastatic Rating', cex=1)
op = par(mfrow=c(2,1))
barplotMD(ref=tostbegg2$d, test=tostbegg2$y, plot='both',
name='Metastatic Rating', cex.legend=.6, pos='top')
par(mfrow=op)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.