marradistree {marradistrees} | R Documentation |
A function for plotting Marradi's trees.
Description
The function plots a Marradi's tree (see Details). The tree trunk length is the mean of the variable and the tree crown radius is the standard deviation. Similar to boxplots, they can be conveniently used to compare a variable mean and standard deviation across subgroups.
Usage
marradistree(m, s, xlab = NULL, ylab = NULL, textv = FALSE, lwd = 3, glab = "")
Arguments
m |
The vector of (sub)group means. |
s |
The vector of (sub)group standard deviations. It must have the same length of |
xlab , ylab |
The horizontal and vertical axis labels. |
textv |
Texts the mean and the standard deviation values on each tree. Default to FALSE. |
lwd |
The line width used to plot the tree. |
glab |
An optional vector of group labels. If NULL, trees are labeled sequentially from left to right. |
Details
A Marradi's tree is a joint, tree-like, graphical representation of a numerical variable. The tree trunk is the mean of the variable and the radius of the tree crown is the standard deviation. It was proposed by Alberto Marradi in his 1993 book (see References).
Value
A plot with n=length(m)
trees representing the mean and standard deviation of the variable across n
subpopulations.
Author(s)
Massimo Cannas
References
Alberto Marradi (1993), L'analisi Monovariata, Franco Angeli Editore, Milano (in Italian), ISBN: 9788820496876.
Examples
set.seed(123) # an example with ten groups
m <- rnorm(10, mean = 5, sd = 1) # group means
s <- runif(10, min = 0, max = 2) # group standard deviations
marradistree(m, s)
marradistree(m, s, textv=TRUE)