pic_stat_shgt_plot: Plot contrasts versus their node height

View source: R/plotting-fxns.R

pic_stat_shgt_plotR Documentation

Plot contrasts versus their node height

Description

Plot the contrasts derived from a rescaled 'unit.tree' against the node height (i.e. depth) at which they are computed

Usage

pic_stat_shgt_plot(
  x,
  xlab = "Node height",
  ylab = "Contrast",
  las = 1,
  col = NA,
  pch = 19,
  cex = 1,
  lwd = 2,
  ...
)

Arguments

x

a unit.tree object (see make_unit_tree).

xlab

x-axis label. Defaults to "Node height".

ylab

y-axis label. Defaults to "Contrast".

las

plot parameter (see par). Defaults to 1.

col

plot colours. The first colour is the colour of the points, the second, the colour of the regression line. If no argument, uses default colours.

pch

plot parameter (see par). Defaults to 19.

cex

plot parameter (see par). Defaults to 1.

lwd

plot parameter (see par). Defaults to 2.

...

additional arguments to be passed to plot.

Details

This function generates a plot of the observed contrasts versus their the node height at which they are computed (see pic). The slope of this plot is equal to the test statistic pic_stat_shgt and is used as a default test statistic in calculate_pic_stat.

If the model is a good fit to the data (i.e. an adequate model), the slope ~ 0. The purpose of the plot is to get a quick visual glance at the data and to assess whether or not the model inadequacy may be driven by outliers.

The function can currently only take a single unit tree (does not integrate across multiple trees).

See Also

make_unit_tree, calculate_pic_stat, pic_stat_shgt

Examples

## finch data
data(finch)
phy <- finch$phy
data <- finch$data[,"wingL"]

u <- make_unit_tree(phy, data=data)

pic_stat_shgt_plot(u)


mwpennell/arbutus documentation built on Oct. 6, 2022, 10 a.m.