Package 'marradistrees'

Title: Plots a Tree-Like Representation of a Numerical Variable (Marradi's Tree)
Description: Provides a single function plotting Marradi's trees: a graphical representation of a numerical variable for comparing the variable mean and standard deviation across subgroups. See A. Marradi "L'analisi monovariata" (1993, ISBN: 9788820496876).
Authors: Massimo Cannas [aut, cre]
Maintainer: Massimo Cannas <[email protected]>
License: GPL-3
Version: 1.0
Built: 2024-12-16 06:32:32 UTC
Source: CRAN

Help Index


Plots a Tree-Like Representation of a Numerical Variable (Marradi's Tree)

Description

Provides a single function plotting Marradi's trees: a graphical representation of a numerical variable for comparing the variable mean and standard deviation across subgroups. See A. Marradi "L'analisi monovariata" (1993, ISBN: 9788820496876).

Details

The DESCRIPTION file:

Package: marradistrees
Type: Package
Title: Plots a Tree-Like Representation of a Numerical Variable (Marradi's Tree)
Version: 1.0
Date: 2023-11-21
Authors@R: person("Massimo", "Cannas", role = c("aut", "cre"), email = "[email protected]")
Maintainer: Massimo Cannas <[email protected]>
Description: Provides a single function plotting Marradi's trees: a graphical representation of a numerical variable for comparing the variable mean and standard deviation across subgroups. See A. Marradi "L'analisi monovariata" (1993, ISBN: 9788820496876).
License: GPL-3
NeedsCompilation: no
Packaged: 2023-11-21 12:13:44 UTC; massimo
Author: Massimo Cannas [aut, cre]
Repository: CRAN
Date/Publication: 2023-11-21 18:50:02 UTC

Index of help topics:

marradistree            A function for plotting Marradi's trees.
marradistrees           Plots a Tree-Like Representation of a Numerical
                        Variable (Marradi's Tree)

Author(s)

Massimo Cannas [aut, cre]

Maintainer: Massimo Cannas <[email protected]>

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)

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 m.

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)